Boost C++ Libraries: Ticket #4542: bind() should use boost::result_of https://svn.boost.org/trac10/ticket/4542 <p> if at all possible boost::bind(F(),...) should use boost::result_of&lt;F(...)&gt; instead of directly accessing F::result_type. </p> <p> this way functors whose result type depends on the argument types could be used in bind(), for example: </p> <pre class="wiki">#include &lt;boost/bind.hpp&gt; #include &lt;boost/utility/result_of.hpp&gt; using namespace boost; struct F{ template&lt;typename Args&gt; struct result; template&lt;typename T&gt; T operator()(T const &amp;t) const{ return t; } }; template&lt;typename T&gt; struct F::result&lt;F(T const &amp;)&gt;{ typedef T type; }; template&lt;typename F&gt; void g(F const &amp;f){ typename boost::result_of&lt;F()&gt;::type res=f(); } int main(){ f(bind(F(),4)); //error. no result_type in F } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4542 Trac 1.4.3 anonymous Sun, 15 Aug 2010 13:03:26 GMT attachment set https://svn.boost.org/trac10/ticket/4542 https://svn.boost.org/trac10/ticket/4542 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bind.patch</span> </li> </ul> <p> PoC patch. only supports 2 arguments and specific bindings </p> Ticket