rem: cerr << "Apply(list) Null:" << endl;
add: std::cerr << "Apply(list) Null:" << std::endl;
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(),                                  osgTypedFunctionFunctor2CPtrRef<                                     Action::ResultE,                                      CNodePtr,                                     Action *                   >(defenter1));    Action::registerLeaveDefault(Core1::getClassType(),                                  osgTypedFunctionFunctor2CPtrRef<                                     Action::ResultE,                                      CNodePtr,                                     Action *                   >(defleave1));    Action *act1;    act1 = Action::create();    cerr << "Apply (c2 unset):" << endl;    act1->apply(g2);        Action::registerEnterDefault(Core2::getClassType(),                                  osgTypedFunctionFunctor2CPtrRef<                                     Action::ResultE,                                      CNodePtr,                                     Action *                   >(defenter2));    Action::registerLeaveDefault(Core2::getClassType(),                                  osgTypedFunctionFunctor2CPtrRef<                                     Action::ResultE,                                      CNodePtr,                                     Action *                   >(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(),                                 osgTypedMethodFunctor2ObjPtrCPtrRef<                                    Action::ResultE,                                    Core1Action,                                    CNodePtr,                                    Action     *>(&gf1, &Core1Action::enter));    act1->registerLeaveFunction(Core1::getClassType(),                                 osgTypedMethodFunctor2ObjPtrCPtrRef<                                    Action::ResultE,                                    Core1Action,                                    CNodePtr,                                    Action     *>(&gf2, &Core1Action::leave));        act1->registerEnterFunction(Core2::getClassType(),                                 osgTypedFunctionFunctor2CPtrRef<                                     Action::ResultE,                                      CNodePtr,                                     Action *                  >(Core2Enter));    act1->registerLeaveFunction(Core2::getClassType(),                                 osgTypedFunctionFunctor2CPtrRef<                                     Action::ResultE,                                      CNodePtr,                                     Action *                  >(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(),                                 osgTypedFunctionFunctor2CPtrRef<                                     Action::ResultE,                                      CNodePtr,                                     Action *                  >(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() );    {        TravActor tact1,tact2;    // traversal function test    cerr << "Traverse(node,enter):" << endl;    traverse(g1,              osgTypedMethodFunctor1ObjPtrCPtrRef<                 Action::ResultE,                 TravActor,                 NodePtr        >(&tact1, &TravActor::enter));        cerr << "Traverse(node,enter):" << endl;    traverse(g1,              osgTypedMethodFunctor1ObjPtrCPtrRef<                 Action::ResultE,                 TravActor,                 NodePtr        >(&tact1, &TravActor::enter));            cerr << "Traverse(list,enter):" << endl;    traverse(g1->getMFChildren()->getValues(),              osgTypedMethodFunctor1ObjPtrCPtrRef<                 Action::ResultE,                 TravActor,                 NodePtr        >(&tact2, &TravActor::enter) );        cerr << "Traverse(node,enter&leave):" << endl;    traverse(g1,              osgTypedMethodFunctor1ObjPtrCPtrRef<                 Action::ResultE,                 TravActor,                 NodePtr        >(&tact1, &TravActor::enter),              osgTypedMethodFunctor2ObjPtrCPtrRef<                 Action::ResultE,                 TravActor,                 NodePtr,                 Action::ResultE>(&tact1, &TravActor::leave) );        cerr << "Traverse(list,enter&leave):" << endl;    traverse(g1->getMFChildren()->getValues(),              osgTypedMethodFunctor1ObjPtrCPtrRef<                 Action::ResultE,                 TravActor,                 NodePtr        >(&tact2, &TravActor::enter),              osgTypedMethodFunctor2ObjPtrCPtrRef<                 Action::ResultE,                 TravActor,                 NodePtr,                 Action::ResultE>(&tact2, &TravActor::leave) );         cerr << "Traverse(node,enter):" << endl;    traverse(g1,              osgTypedFunctionFunctor1CPtrRef<                 Action::ResultE,                  NodePtr        >(traventer));            cerr << "Traverse(list,enter):" << endl;    traverse(g1->getMFChildren()->getValues(),              osgTypedFunctionFunctor1CPtrRef<                 Action::ResultE,                  NodePtr        >(traventer) );        cerr << "Traverse(node,enter&leave):" << endl;    traverse(g1,              osgTypedFunctionFunctor1CPtrRef<                 Action::ResultE,                  NodePtr        >(traventer),              osgTypedFunctionFunctor2CPtrRef<                 Action::ResultE,                 NodePtr,                 Action::ResultE>(travleave) );        cerr << "Traverse(list,enter&leave):" << endl;    traverse(g1->getMFChildren()->getValues(),              osgTypedFunctionFunctor1CPtrRef<                 Action::ResultE,                  NodePtr        >(traventer),              osgTypedFunctionFunctor2CPtrRef<                 Action::ResultE,                 NodePtr,                 Action::ResultE>(travleave) );    }    // 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 );}