C++ Logo

sg7

Advanced search

Re: [SG7] Thoughts on deep-constness and constexpr bindings for reflection

From: Matus Chochlik <chochlik_at_[hidden]>
Date: Fri, 3 Dec 2021 11:49:43 +0100
Hi,

On Fri, Dec 3, 2021 at 1:23 AM Jean-Baptiste Vallon Hoarau via SG7 <
sg7_at_[hidden]> wrote:

> Hi,
>
> Being able to create constexpr binding of non-trivial types seems useful
> for reflection and metaprogramming. For example, for querying and storing a
> name that is intended to be used during the runtime. This can be done (as
> in the TS) with const char*, but 1/ this is not very ergonomic and 2/ does
> this imply that every data resulting from a reflection query will be stored
> in the binary of the TU, regardless of whether or not it's needed? (I think
> it does).
>

I'm not sure if I understand correctly what you are saying here, but using
the string-returning operations doesn't necessarily mean that the resulting
string literal always becomes part of the final binary:
https://compiler-explorer.com/z/csav31MEn

>
>
>

Received on 2021-12-03 04:49:56