bienstman2.cpp 678 B

12345678910111213141516171819202122232425262728
  1. // Copyright David Abrahams 2004. Distributed under the Boost
  2. // Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include <boost/python/module.hpp>
  5. #include <boost/python/def.hpp>
  6. #include <boost/python/class.hpp>
  7. struct C {};
  8. struct D {};
  9. struct E
  10. {
  11. const D fe (const C&) {return D();}
  12. const D fe2(const C&, const C&) {return D();}
  13. };
  14. BOOST_PYTHON_MODULE(bienstman2_ext)
  15. {
  16. using namespace boost::python;
  17. class_<C>("C");
  18. class_<D>("D");
  19. class_<E>("E")
  20. .def("fe", &E::fe) // this compiles.
  21. .def("fe2", &E::fe2) // this doesn't... well, now it does ;-)
  22. ;
  23. }