[C++-sig] "Returning" to Scope

troy d. straszheim troy at resophonic.com
Mon Aug 18 18:07:48 CEST 2008


Bilokon, Paul wrote:
> Hi,
> 
> I'm trying to figure out how I can "return" to a previously defined
> scope. 

Scopes essentially push and pop themselves off a static stack of scopes
as they are created/destroyed, so you can generally just use... scopes:

BOOST_PYTHON_MODULE(scope)
{
   {
     scope s = class_<Foo> ...
     enum_<Foo::Something> ...	
   }

   {
      scope s = class_<Baz> ...
      enum_<Baz::Something> ...
   }

   class_<Quux> ...
}



-t



More information about the Cplusplus-sig mailing list