Date: Tue, 10 Nov 2020 16:25:20 -0300
>
> En effet!. I very much appreciate that you folded that work into yours btw.
> If I remember correctly, in my design (and yours), the attribute function
> returns an instance of the type directly,
> I think what Cleiton is proposing is that the compiler would return a
> reflection of the synthetized value
>
Probably, what I was thinking is "where would be the point of instantiation
of the attribute" ?
Other questions:
1 - If you ask the std::meta::attribute n times it will be copied n times ?
2 - constexpr auto y = std::meta::attribute<Y&>(reflexpr(W)) // can I
get a reference to Y ? could it be copy free ?
3 - Can I call functions in the attribute that returns consteval literal
types ?
4 - Can attributes be template instantiations ?
5 - Attributes in templates will have different instantiations for every
instance of the template ?
struct A{};
struct B{ constexpr i; }
[[A(int)]] // <- this is one for all template instantiations ?
template<int B>
[[B{N}]] // <- one per instantiation ? template dependent parameter in
attributes ?
struct Z{};
Thanks
> En effet!. I very much appreciate that you folded that work into yours btw.
> If I remember correctly, in my design (and yours), the attribute function
> returns an instance of the type directly,
> I think what Cleiton is proposing is that the compiler would return a
> reflection of the synthetized value
>
Probably, what I was thinking is "where would be the point of instantiation
of the attribute" ?
Other questions:
1 - If you ask the std::meta::attribute n times it will be copied n times ?
2 - constexpr auto y = std::meta::attribute<Y&>(reflexpr(W)) // can I
get a reference to Y ? could it be copy free ?
3 - Can I call functions in the attribute that returns consteval literal
types ?
4 - Can attributes be template instantiations ?
5 - Attributes in templates will have different instantiations for every
instance of the template ?
struct A{};
struct B{ constexpr i; }
[[A(int)]] // <- this is one for all template instantiations ?
template<int B>
[[B{N}]] // <- one per instantiation ? template dependent parameter in
attributes ?
struct Z{};
Thanks
Received on 2020-11-10 13:25:35