Hi -
Using Boost 1.53.0, the following code fails to compile with g++, when
c++11 is enabled:
#include
#include
struct A{}; struct B{};
typedef boost::variant my_variant;
void foo(boost::python::object o) {
my_variant v = boost::python::extract(o);
}
The error is:
/home/bcatanzaro/boost_
Thanks Jim, adding the extra parentheses solved the problem.
I'll contact the Boost.Variant people.
- bryan
On Tue, May 7, 2013 at 4:28 PM, Jim Bosch wrote:
> On 05/07/2013 07:19 PM, Bryan Catanzaro wrote:
>
>> Hi -
>> Using Boost 1.53.0, the following code fails to
Hi -
Using Boost 1.53.0, the following code fails to compile with g++, when
c++11 is enabled:
#include
#include
struct A{}; struct B{};
typedef boost::variant my_variant;
void foo(boost::python::object o) {
my_variant v = boost::python::extract(o);
}
The error is:
/home/bcatanzaro/boost_
+ type:
> boost::shared_ptr
> class_, boost::noncopyable
>>("A", init<>())
> #endif
> .def("ptr", &A::ptr)
> .def("foo", &A::foo)
> ;
> }
> ---
>
> foo.py
> imp
Holger Brandsmeier gmx.de> writes:
>
> Dear list,
>
> how is it possible to have a class in C++ that can be extended from
> python and that stores a weak_ptr to itself?
Have you tried using boost::enable_shared_from_this? The following example code
seems to do what you want.
f