<div class="gmail_quote">On Wed, Nov 28, 2012 at 7:35 PM, Nathan Crookston <span dir="ltr">&lt;<a href="mailto:nathan.crookston@gmail.com" target="_blank">nathan.crookston@gmail.com</a>&gt;</span> wrote:<br>[...]<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
With or without a change to result_of, I believe there&#39;s value in allowing the user to explicitly specify the result_type of a callable object passed to transformed. �Ticket #7748[1] contains a patch which permits that.<div class="gmail_extra">
<div class="gmail_quote">
<div><br></div><div>Thanks,</div><div>Nate</div><div><br></div><div>[1]�<a href="https://svn.boost.org/trac/boost/ticket/7748" target="_blank">https://svn.boost.org/trac/boost/ticket/7748</a></div></div></div></blockquote>
<div><br>I would think a preferable (in the sense of separation of concerns, modularity, what-have-you) solution would be an addition to Boost.Functional (or whatever) that basically wraps a callable object and forces its result_type to be some specified template parameter. E.g.,<br>
<br>template&lt; class F, class R &gt;<br>struct result_binder<br>{<br>� F f;<br>� typedef R result_type;<br>� template&lt; class... T &gt;<br>� result_type operator()(T&amp;&amp;... x) const<br>� { return f(std::forward&lt;T&gt;(x)...); }<br>
};<br><br>template&lt; class R, class F &gt;<br>result_binder&lt;F,R&gt;<br>bind_result(F&amp;&amp; f)<br>{ return result_binder&lt;F,R&gt;{std::forward&lt;F&gt;(f)}; }<br><br>[or something like that]<br><br>- Jeff<br><br>
</div></div>