<br><div class="gmail_extra"><div class="gmail_quote">Eric Niebler wrote:<br>Here&#39;s the surprising part:<br>
<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Jeffrey Lee Hellrung, Jr. wrote:<br><div class="im">
&gt; - If F::result_type exists, return F::result_type;<br>
&gt; - Else:<br>
&gt;    - If BOOST_NO_CXX11_DECLTYPE, return F::result&lt; F ( Args... ) &gt;<br>
&gt;    - Else, if F::result&lt;&gt; exists, return F::result&lt; F ( Args... ) &gt;<br>
&gt;    - Else return decltype( declval&lt;F&gt;() ( declval&lt; Args &gt;()... ) )<br>
<br>
</div>The way I read this is that F::result_type (and F::result&lt;&gt;) is taking<br>
precedence over decltype. AFAICT, you&#39;re suggesting that result_of *not*<br>
compute the actual return type of a function object, but rather return<br>
the declared result type, even if it&#39;s wrong.<br>
<br>
In moving to a decltype-based result_of, we discovered just how many<br>
function objects in boost were lying about their return types via the<br>
TR1 result_of protocol. Now that we have decltype, we can get the right<br>
answer always. I would be *immensely* surprised if result_of ever got<br>
the wrong answer on a compiler that had decltype.<br></blockquote><div> </div><div>I understood the suggestion to apply when compilers had pre-3276 decltype -- so the above wouldn&#39;t apply to latest clang, nor to other compilers once they support incomplete types.<br>
 </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
And btw, I don&#39;t think lambdas are required to have a nested result_type<br>
typedef, are they? So what benefit does changing the protocol have?<br>
Wouldn&#39;t you still need a wrapper anyway?<br></blockquote><div> No, they&#39;re not required.  That&#39;s the heart of the issue -- if result_of were modified (only for lacking compilers) to fall back to decltype, then the lack of result_type wouldn&#39;t require special handling by the user.<br>
<br>Thanks,<br>Nate<br><br></div></div></div>

