<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 2, 2015 at 5:27 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Feb 2, 2015 at 5:27 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>On Tue, Jan 27, 2015 at 11:34 AM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span><br><div><blockquote type="cite"><div>On Jan 27, 2015, at 12:03 AM, Ben Pope <<a href="mailto:benpope81@gmail.com" target="_blank">benpope81@gmail.com</a>> wrote:</div><br><div>On Tuesday, January 27, 2015 03:59 PM, Ben Pope wrote:<br><blockquote type="cite">On Tuesday, January 27, 2015 02:28 PM, Michael Haidl wrote:<br><blockquote type="cite">Hi all,<br><br>I am curious about the proposed invocation traits<br>(<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3866.html" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3866.html</a>) and<br>life would be a lot easier if they would make it into the next C++<br>standard (at least for me). However 201z is far away and I was wondering<br>if someone is already working on this in clang. If not can someone<br>direct me to the right spot in clang where such a feature would be in<br>the right place?<br></blockquote><br>I'm not sure what happened, they appear to have made it to N3908, then<br>to N4023, then to N4081 but they don't appear in N4270.<br><br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/</a><br></blockquote><br>They're hiding here:<br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4335.html" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4335.html</a></div></blockquote><br></div></span><div>In other words, they’ll appear in libc++.</div><div>[ We’re trying to get a full LFTS implementation in there, but it’s not all there yet ]</div></div></blockquote><div><br></div></div></div><div>We should figure out what intrinsics you guys want in order to support this. I believe it's straightforward to implement invocation_type in terms of raw_invocation_type in the library, so I think providing simply a __raw_invocation_type(Fn, Arg1, Arg2, ...) would work?</div></div></div></div></blockquote><div><br></div></span><div>(And it's up to you whether you'd prefer these arguments to be expressions or types...)</div></div></div></div></blockquote><div><br></div><div>Ping. Mashall, Eric: do you have a preference on what compiler support you want here? The most general option is probably:</div><div><br></div><div>  __raw_invocation_type(expression)</div><div><br></div><div>where the expression is required to be some kind of call expression, and the type of __raw_invocation_type is the type of the callee. This allows you to introspect the result of overload resolution, etc.<br></div><div><br></div><div>However, this violates the tradition of std_trait<Args...> mapping exactly to __std_trait(Args...), so perhaps we should give it a different name to avoid colliding with other compilers' eventual extensions. Or we could just provide a __raw_invocation_type trait that takes a single function type and computes the result type as specified by the TS.</div><div><br></div><div>Thoughts?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Looking at N4335 now, I'm a little concerned that we may be standardizing a bad interface; we don't support using raw_invocation_type<F(Args...)> if F is a function type, because that would create a function type whose return type is a function type, which is ill-formed.</div></div></div></div>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>