tags:

views:

77

answers:

1

I have been toying with an example hpp provided in the boost library and I am trying to figure out how to use this parameter_types function correctly.

From the boost doc, parameter_types needs a ClassTypeTransform in order to parse class member function signatures.

I want to parse member function signatures, but I cannot find any doc on what this lamda expression is supposed to do.

ClassTransform MPL - Lambda Expression to transform the class type if F is a member function pointer

Which is from the page itself, I cannot find any sample code actually using it and I was hoping someone know how to use it to parse member function signatures.

+1  A: 

ClassTransform is simply used to modify the first argument type in case parameter_types<> is applied to a member function pointer type. The default is add_reference<_>, so for instance:

parameter_types<void(X::*)(int)>::type -> SomeSequence<void, X&, int>
parameter_types<void(X::*)(int), mpl::identity<_> >::type -> SomeSequence<void, X, int>
parameter_types<void(X::*)(int), add_pointer<_> >::type -> SomeSequence<void, X*, int>
Daniel Wallin
ahh, I see, thanks for the answer
Charles