Boost logo

Boost Users :

From: Benjamin Schmeling (Benjamin_Schmeling_at_[hidden])
Date: 2005-02-01 13:38:22


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net