C++ Logo


Advanced search

Re: [SG7] Update: P1240R2 — Scalable Reflection

From: Daveed Vandevoorde <daveed_at_[hidden]>
Date: Tue, 18 Jan 2022 14:09:12 -0500
> On Jan 18, 2022, at 1:46 PM, Peter Dimov <pdimov_at_[hidden]> wrote:
> Daveed Vandevoorde wrote:
>> How about specifying that all string_view results from reflection functions
>> (there aren’t that many) have a null-terminated data()?
>> E,g,:
>> auto len = std::strlen(name_of(^S).data()); // Okay and as intuitively
>> expected.
> Works for me, with the minor addition of `constexpr` before `auto len`.

Can you elaborate on the minor addition? Are you just asking for std::strlen to be guaranteed evaluatable at compile time for strings?


Received on 2022-01-18 19:09:13