
"David Abrahams" <dave@boost-consulting.com> wrote
"Arkadiy Vertleyb" <vertleyb@hotmail.com> writes:
"David Abrahams" <dave@boost-consulting.com> wrote
I can't ask my library's users to register types.
Don't you have to ask them to do something else, so that result_of works?
No, we'd implement the necessary type computations to make result_of work. Remember, result_of takes types as inputs, not objects.
So,
result_of<bind_(std::minus<int>, int, _1_)>::type
just requires that bind_ know about the types produced by boost::bind. And in
result_of<minus_(int, _1_)>::type
minus_ would just have to know how the operator- in the lambda library works.
I see. However BOOST_TYPEOF, although does require user type registration, has an advantage of much nicer syntax. Compare: result_of<minus_(minus_(int, _1_), _2_)>::type f = 3 - _1 - _2; with BOOST_AUTO(f, 3 - _1 - _2); It would be very nice to have lambda and bind types registered, so that the user at least have a choise. Regards, Arkadiy