C++ Logo

sg7

Advanced search

Re: [SG7] From TMP to value-based reflection

From: Peter Dimov <pdimov_at_[hidden]>
Date: Wed, 8 Dec 2021 20:40:09 +0200
Matus Chochlik wrote:
> Sorry I omitted consteval, this should have been:
>
> consteval auto unreflect_type(meta::info mo) {
> return std::type_identity<typename [: mo :]>{};
> }

I'm going by memory so I may get something wrong,
but when I played with this, even something like

consteval bool is_const( meta::info info )
{
    return std::is_const_v<[: info :]>;
}

didn't work. Note that this doesn't vary the return
type.

This means that all the consteval primitives like
is_const have to be supplied by std, users can't write
their own.

I don't however remember whether this was a
limitation of the reference implementation, or of
the underlying model.

Received on 2021-12-08 12:40:15