This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 3.8) | |
| project(SharedDataPybind11) | |
| add_subdirectory(pybind11) | |
| add_library(SharedCounter SHARED SharedCounter.cpp) | |
| target_compile_features(SharedCounter PUBLIC cxx_std_11) | |
| if (WIN32) | |
| target_compile_definitions(SharedCounter PRIVATE SharedCounter_EXPORTS) | |
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <pybind11/embed.h> | |
| #include "with.h" | |
| #include <fstream> | |
| #include <iostream> | |
| namespace py = pybind11; | |
| class PrintingMgr { public: int enter() { std::cout << "__enter__" << " - " << std::flush; return 42; }; void exit(const py::object &type, const py::object &value, const py::object &traceback) { std::cout << " - " << "__exit__" << std::endl; py::print(type, value, traceback); }; }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef INC_FUNCTOR_SIGNATURE_H | |
| #define INC_FUNCTOR_SIGNATURE_H | |
| #include <boost/mpl/erase.hpp> | |
| #include <boost/mpl/vector.hpp> | |
| namespace boost { | |
| namespace python { | |
| namespace detail { | |
| template <class Functor> |