Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <boost/python.hpp>
- #include <string>
- #define MODULE BOOST_PYTHON_MODULE
- namespace py = boost::python;
- namespace Export
- {
- template<typename T>
- void class_aux(T& cls)
- {
- return;
- }
- template<typename T, typename F0_str, typename F0, typename... Fn>
- void class_aux(T& cls, F0_str f0_str, F0 f0, Fn... fn)
- {
- cls = cls.def(f0_str, f0);
- class_aux(cls, fn...);
- }
- template<typename T, typename... Fn>
- void class_(std::string name, Fn... fn)
- {
- py::class_<T> cls(name.c_str());
- class_aux(cls, fn...);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment