#include <boost/python.hpp>
#include <iostream>

using namespace boost::python;
using std::cout;
using std::endl;

// Mockup abstract type.
class polygon {
public:
  polygon() {}
  virtual int area () = 0;
  void print (){
    cout << "in polygon::print()" << endl;
  }
  virtual ~polygon() = default;
};

// Wrapper to allow calling Python overrides.
struct polygon_wrap : polygon, wrapper<polygon> {
  polygon_wrap(): polygon() {}
  int area() { return this->get_override("area")(); }
};

BOOST_PYTHON_MODULE(_pure_virtual_inherit_example) {
  // Expose models.
  class_<polygon_wrap, boost::noncopyable>("Polygon", init<>())
    .def("area", pure_virtual(&polygon::area))
    .def("print", &polygon::print)
  ;
}
