$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] boost::result_of template
From: John M. Dlugosz (mpbecey7gu_at_[hidden])
Date: 2012-04-13 07:22:43
Consider these functions:
template <typename F>
unique_future<typename boost::result_of< F() >::type>
foo (F&& f) { â¯
template <typename F, typename A1>
unique_future<typename boost::result_of< F(A1) >::type>
foo (F&& f, A1&& a1)
{
return foo (std::tr1::bind(f,a1));
}
I can call foo(&bar,5) to mean the same thing as foo(bind(&bar,5)), OK.
But I cannot call foo(&C::mf, pc) to mean the same as foo(bind(&C::mf,pc)) when the
binding in question is pc->mf().
That is, bind treats a member function automatically as a function whose first argument is
'this', but boost::result_of does not have the same trick.
How can I express the result type of the second form of foo shown above?
âJohn