Ticket #6895: boosterror.cpp

File boosterror.cpp, 424 bytes (added by Maciej Dems <maciej.dems@…>, 10 years ago)

Source code to reproduce the bug.

Line 
1#include <iostream>
2#include <boost/shared_ptr.hpp>
3#include <boost/python.hpp>
4
5using boost::shared_ptr;
6using namespace boost::python;
7
8struct A {
9 virtual void f() { std::cout << "A OK!\n"; }
10};
11
12struct B : public A {
13 void f() { std::cout << "B OK!\n"; }
14};
15
16BOOST_PYTHON_MODULE(boosterror)
17{
18
19 class_<A, shared_ptr<A> >("A")
20 .def("f", &A::f)
21 ;
22
23 class_<B, shared_ptr<B>, bases<A> >("B")
24 ;
25
26}