Hi all,

I'd like to implement a callback that takes two references to 
std::string and returns a bool via a Functor.
But I can't find a function that wraps a matching member function call 
(if I understand the naming scheme correctly, this should be something 
like 'osgTypedMethodFunctor2ObjRef').

Am I missing something or do I have to use the pointer variant given below?


// what I want
TypedFunctor2Base<
     bool, RefCallArg< std::string const >, ArgsCollector< std::string& >
 > callbackWithRef;

// what I can get to work
TypedFunctor2Base<
     bool, PtrCallArg< std::string const >, ArgsCollector< std::string& >
 > callbackWithPtr;


// works with CallbackWithPtr
bool takesPtr( std::string const* arg1, std::string& arg2 )
{ return true; }

// works with CallbackWithRef
bool takesRef( std::string const& arg1, std::string& arg2 )
{ return true; }

struct S
{
   // works with CallbackWithPtr
   bool takesPtr( std::string const* arg1, std::string& arg2 )
   {return true;}

   // works not with CallbackWithRef?
   bool takesRef( std::string const& arg1, std::string& arg2 )
   {return true;}
} s;

// this works
callbackWithPtr = osgTypedMethodFunctor2ObjPtr<
     bool, S, std::string const, std::string&
 >( &s, &S::takesPtr );

// can't find this function...
callbackWithRef = osgTypedMethodFunctor2ObjRef<
     bool, S, std::string const, std::string&
 >( &s, &S::takesRef );


Regards,
Karsten


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to