[GSoC] Compiler support for invocation_type
Jonathan Wakely
jwakely@redhat.com
Wed Aug 19 09:04:00 GMT 2015
On 19/08/15 01:44 -0400, Fan You wrote:
>Hi,
>
>I'm working on implementing invocation_type
><http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3866.html>
>
>However, I find it hard to get the matched invocation parameter of
>function F by specialization and SFINAE.
>
>For example:
>
>int f(const char*);
>int f(int);
>
>How can I get the invocation parameter of INVOKE(f, "abc")? which
>should be (const char*).
In general, you can't.
>I saw invocation_type is a compiler-supported type, but I don't know
>how to make use of the compiler to achieve this.
That means you need the compiler to provide a new built-in like the
ones listed at https://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html
It's not possible to implement invocation_type without it.
More information about the Libstdc++
mailing list