C++ Logo

sg7

Advanced search

Re: [SG7] TS Reflection experimental implementation in Clang available

From: Matus Chochlik <chochlik_at_[hidden]>
Date: Tue, 23 Nov 2021 16:52:26 +0100
Hi,

On Tue, Nov 23, 2021 at 3:28 PM Cleiton Santoia via SG7 <
sg7_at_[hidden]> wrote:

> Sorry if I´m a little bit off, but this implementation is from that
> "type-based" proposal ?
>

Correct, it implements the recently published reflection TS [
https://www.iso.org/standard/76425.html]


> What about the "meta::info" proposal ? It is not going forward ?
>
>
> anyway, I tried this but could not get the name of X inside a template
> function:
>
> void foo(auto x) {
> using r = reflexpr( decltype(x) );
> std::cout << "Name of type template 'T':" << get_name_v<r> << std::endl;
> };
>
> struct X {} x;
> foo(x);
>
>
> https://compiler-explorer.com/z/n3T8f3sdz
>
> Is it supposed to work ?
>
The implementation is still work-in-progress, not completely debugged and
partially based on a PoC from 2019 where `auto`-typed regular function
arguments were not implemented yet.
Eventually, this is supposed to work.

BR,
--Matus

Received on 2021-11-23 09:52:39