[C++-sig] problem with constructor/implicitly_convertible

Benjamin Schmeling Benjamin_Schmeling at gmx.de
Tue Feb 1 19:37:20 CET 2005


Hi,
I have defined the following:

bigint* bigint_constructor(long_ l){
    return new bigint(to_bigint(l));
}

class_<bigint>("bigint")
.def("__init__", make_constructor(bigint_constructor))
....
....

implicitly_convertible<boost::python::long_, bigint>();

Now I want to have a implicit conversion from long_ to bigint. My 
original c++ class has no constructor with long_ but my python-bigint 
class. The compiler tries to find one on c++ bigint and doesn't find it. 
How should I use implicitly_convertible to reach my goal?

Benjamin



More information about the Cplusplus-sig mailing list