bienstman3.cpp 573 B

1234567891011121314151617181920212223242526
  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 V
  8. {
  9. virtual ~V() {}; // silence compiler warningsa
  10. virtual void f() = 0;
  11. };
  12. struct B
  13. {
  14. B(const V&) {}
  15. };
  16. BOOST_PYTHON_MODULE(bienstman3_ext)
  17. {
  18. using namespace boost::python;
  19. class_<V, boost::noncopyable>("V", no_init);
  20. class_<B>("B", init<const V&>());
  21. }