C++ Logo

sg7

Advanced search

Re: [SG7] Update: P1240R2 — Scalable Reflection

From: Peter Dimov <pdimov_at_[hidden]>
Date: Tue, 18 Jan 2022 20:46:20 +0200
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`.

Received on 2022-01-18 18:46:22