rem: cerr << "Traverse(node,enter):" << endl; traverse(g1, osgFunctionFunctor1(traventer) );
context: int main( int argc, char *argv[] ){    osgInit(argc, argv);	// build simple tree: g1|((g2|t2),t1)    NodePtr g1 = Node::create();    Core1Ptr g1c = Core1::create();	g1->setCore( g1c );    NodePtr g2 = Node::create();    Core1Ptr g2c = Core1::create();	g2->setCore( g2c );    NodePtr t1 = Node::create();    Core2Ptr t1c = Core2::create();	t1->setCore( t1c );    NodePtr t2 = Node::create();    Core2Ptr t2c = Core2::create();	t2->setCore( t2c );	g2->addChild( t2 );	g1->addChild( g2 );	g1->addChild( t1 );		// two instances for check instance calling	Core1Action gf1,gf2;	// register a default function. Should be copied at 	// instantiation time	Action::registerEnterDefault(Core1::getClassType(),                                osgFunctionFunctor2(defenter1));	Action::registerLeaveDefault(Core1::getClassType(),                                osgFunctionFunctor2(defleave1));	Action *act1;	act1 = Action::create();	cerr << "Apply (c2 unset):" << endl;	act1->apply(g2);		Action::registerEnterDefault(Core2::getClassType(),                                osgFunctionFunctor2(defenter2));	Action::registerLeaveDefault(Core2::getClassType(),                                osgFunctionFunctor2(defleave2));	cerr << "Apply (c2 unset, pickup from default):" << endl;	act1->apply(g2);		Action *act2;	act2 = Action::create();	cerr << "Apply (c2 set):" << endl;	act2->apply(g2);		// assign functors    act1->registerEnterFunction(Core1::getClassType(),                          osgMethodFunctor2Ptr(&gf1, &Core1Action::enter));    act1->registerLeaveFunction(Core1::getClassType(),                          osgMethodFunctor2Ptr(&gf2, &Core1Action::leave));		act1->registerEnterFunction(Core2::getClassType(),                                osgFunctionFunctor2(Core2Enter));	act1->registerLeaveFunction(Core2::getClassType(),                                osgFunctionFunctor2(Core2Leave));	// set act1 as the prototype		Action::setPrototype( act1 );		// call on single node	cerr << "Apply(leaf):" << endl;	act1->apply( t1 );	// call on single node	cerr << "Apply(leaf), second action :" << endl;	act2->apply( t1 );		// call on single node	// act2 should now have the same functions		delete act2;	act2 = Action::create();	cerr << "Apply(leaf), second action from prototype:" << endl;	act2->apply( t1 );	// call on node with single child:	cerr << "Apply(node):" << endl;	act1->apply( g2 );	// call on tree:	cerr << "Apply(tree):" << endl;	act1->apply( g1 );	//use a function that only traverses the first node (if any)	act1->registerEnterFunction(Core1::getClassType(),                          osgFunctionFunctor2(firstOnly));	cerr << "Apply(single child traversal):" << endl;	act1->apply( g1 );	// call on node with single child:	cerr << "Apply(list):" << endl;	act1->apply( g1->getMFChildren()->begin(), g1->getMFChildren()->end() );#if 0 // !!! what the &%$^&# is going on here?    // traversal function test    	cerr << "Traverse(node,enter):" << endl;    traverse(g1, osgFunctionFunctor1(traventer) );    	cerr << "Traverse(list,enter):" << endl;    traverse(g1->getMFChildren()->getValues(), osgFunctionFunctor1(traventer) );    	cerr << "Traverse(node,enter&leave):" << endl;    traverse(g1, osgFunctionFunctor1(traventer),                  osgFunctionFunctor1(travleave) );    	cerr << "Traverse(list,enter):" << endl;    traverse(g1->getMFChildren()->getValues(), osgFunctionFunctor1(traventer),                                                osgFunctionFunctor1(travleave) );#endif      	// try the error checks	// NULL nodes	vector<NodePtr> nullvec;	nullvec.push_back( NullFC );	cerr << "Apply(list) Null:" << endl;	act1->apply( nullvec.begin(), nullvec.end() );	cerr << "Apply(node) Null:" << endl;	act1->apply( NullFC );	NodePtr g3 = Node::create();	cerr << "Apply(node) without core:" << endl;	act1->apply( g3 );}