[C++-sig] C1204:Compiler limit quick question

Scott A. Smith ssmith at magnet.fsu.edu
Fri Dec 6 15:46:51 CET 2002


I have a quick question on avoiding error C1204 when using
BP and MSVC++ V6. I break up my code into separate files to
avoid the problem as directed in

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/boost/boost/libs/p
ython/doc/v2/faq.html#c1204

Works great. But when it comes to doing so in a class I don't
see how to get an instance of my class into the module definition.
If I have my BP module (following along with the FAQ)

BOOST_PYTHON_MODULE(my_module)
{
   def("foo", foo);
   ...
   class_<my_class>("my_class", init<>())
   ...
   ;
   more_of_my_class(x);   <======= ???
}

void more_of_my_class(class<my_class>& x)
{
   x
     .def("baz", baz)
     .add_property("xx", &my_class::get_xx, &my_class::set_xx)
     ;
   ...
}

How to I get an reference to an instance of my_class?
That is, where do I get the x for the line "more_of_my_class(x);"
assuming this is the correct means of breaking up the class?

Thanks, Scott





More information about the Cplusplus-sig mailing list