[C++-sig] static data members (fwd) -- oops

Francois Ostiguy ostiguy at fnal.gov
Tue Oct 8 22:46:07 CEST 2002


There was I typo in my previous message. It should have read as follows:

I am stumped. I cannot get the code below to compile.
I get the following message from g++ 3.1.1:

py-ring.cc: In function `void init_module_ring()':
py-ring.cc:26: parse error before `=' token


module("ring")
     .add (
       ring_class object = class_<Ring>("Ring", python::args<>() )
       .def("doTurn", &Ring::doTurn)
     );

     ring_class.attr("nodesInitialized")  = Ring::nodesInitialized;

...

where

Ring::nodesInitialized is a static variable
Ring::doTurn is a static method

Ring has both static and non-static data/function members.


-Francois

----------------------------------------------------------------------------
Dr. Jean-Francois OSTIGUY                              voice: (630) 840-2231
Beam Physics Dept MS220                                  FAX: (630) 840-6039
Fermi National Accelerator Laboratory                email: ostiguy at fnal.gov
Batavia IL 60510-0500                           WWW:www-ap.fnal.gov/~ostiguy



_______________________________________________
C++-sig mailing list
C++-sig at python.org
http://mail.python.org/mailman/listinfo/c++-sig





More information about the Cplusplus-sig mailing list