开发者

How to use boost::function_types::parameter_types with ClassTypeTransform

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.


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜