C++ Logo

sg7

Advanced search

Re: [SG7] Update: P1240R2 — Scalable Reflection

From: Andrey Davydov <andrey.davydov_at_[hidden]>
Date: Sun, 16 Jan 2022 16:36:21 +0300
I wonder what is the lifetime of underlying storage referenced by std::span
returned from such functions as std::meta::members_of? Is this array
persisted throughout the compilation process?

Another question is why s_members.size() == 7 in the example on page 35?
Why members_of(^S) include generated constructors and the destructor, but
don't include generated assignment operators?

If i understand correctly std::meta::parameters_of could return function
parameters or template parameters depending on the argument, and so for the
following function template:

template<typename X, typename Y>
void f(X a, Y b);

parameters_of(^f) == {^X, ^Y};
parameters_of(^f(1, 2)) == {^a, ^b};

And likewise for generic lambda
auto lambda = []<typename X, typename Y>(X a, Y b) {};

parameters_of(^decltype(lambda)) == {^X, ^Y};
parameters_of(^lambda(1, 2)) = {^a, ^b};

Maybe it makes sense to split function `parameters_of` to 2 separate
functions `function_parameters_of` and `template_paramters_of`?

On Sat, Jan 15, 2022 at 8:41 PM Daveed Vandevoorde via SG7 <
sg7_at_[hidden]> wrote:

> Hello reflecting friends,
>
> (And Happy New Year!)
>
> I’ve uploaded on the 2022 Teleconferences wiki for SG-7 an updated version
> of P1240 (which has also been submitted for the next mailing).
>
> Changes include:
> — The syntax agreements that SG-7 voted through P2320 (e.g.,
> prefix ^ instead of reflexpr(…) to create reflections)
> — The proposed metafunctions now use span and string_view instead
> of vector and string
> — Various corrections and clarifications based on reader feedback
> and implementation experience
>
> Daveed
>
> --
> SG7 mailing list
> SG7_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg7
>

--
Andrey Davydov

Received on 2022-01-16 13:36:33