<div class="gmail_quote">On Wed, Nov 28, 2012 at 7:35 PM, Nathan Crookston <span dir="ltr"><<a href="mailto:nathan.crookston@gmail.com" target="_blank">nathan.crookston@gmail.com</a>></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'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< class F, class R ><br>struct result_binder<br>{<br>� F f;<br>� typedef R result_type;<br>� template< class... T ><br>� result_type operator()(T&&... x) const<br>� { return f(std::forward<T>(x)...); }<br> };<br><br>template< class R, class F ><br>result_binder<F,R><br>bind_result(F&& f)<br>{ return result_binder<F,R>{std::forward<F>(f)}; }<br><br>[or something like that]<br><br>- Jeff<br><br> </div></div>