[C++-sig] module variable

Neal Becker ndbecker2 at gmail.com
Sun Jul 29 16:28:31 CEST 2007


I can create a module variable like this:

static func_that_needs_x () {
// How do I access the value of x?
}

BOOST_PYTHON_MODULE () {
  scope().attr ("x") = 2;
  def ("func", &func_that_needs_x);
}

But suppose I have a c++ function that needs to access the value?  How do I
do this?




More information about the Cplusplus-sig mailing list