[C++-sig] external constructors

John Reid j.reid at mail.cryst.bbk.ac.uk
Thu Jul 17 23:35:03 CEST 2008


http://tinyurl.com/6zf9s6

e.g.
	class_<
		observed_data
	>(
		"ObservedData",
		"Observed data for gapped pssm model",
		no_init
	)
	.def(
		"__init__",
		make_constructor( create_observed_data )
	)
	;

John.

Gennadiy Rozental wrote:
> Hi,
> 
> is there any way to register external constructor for C++ class?
> 
> Specifically If I have class 
> class A {
> ...
> };
> 
> I want to register constructor like this:
> 
> class_<A>(...)
>  .def( "__init__", &make_A )
> 
> where make_A is defined something like:
> 
> void
> make_A( A&, boost::python::list const& );
> 
> Doesn't seem to work like this.
> 
> Gennadiy




More information about the Cplusplus-sig mailing list