You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been experimenting with p2996, and have encountered use cases for which I don't understand the behavior, and would appreciate a helping hand.
Use cases
Considering the following template:
template<int n>
struct generated_template_test;
Case *1:
If I specialize it in the root namespace via:
template<>
struct generated_template_test<42> {};
I observe that the return value of members_of(^::).size() increments by 1, which is what I expected.
Case *2:
On the other hand, if I do the specialization like this (in the root namespace): static_assert(is_type(define_aggregate(substitute(^generated_template_test, {std::meta::reflect_value(42)}), {})));
I observe that the return value of members_of(^::).size() does not change, which I find strange, whereas the specialized version of template can be instantiated perfectly well.
Case *3:
Furthermore, if I specialize the template in a namespace (also works with a class):
The situation seems to be perfectly similar to *2.
Questions
This raises the following questions:
A/ Is case *3 allowed (class specialization in a namespace)?
B/ Is it normal for the return of members_of(^::).size() and members_of(^a_namespace).size() not to change once the template has been specialized?
C/ Is there a way to browse all the specializations of a template class?
Thank you for your time, I really appreciate your work.
The text was updated successfully, but these errors were encountered:
Hi
I've been experimenting with p2996, and have encountered use cases for which I don't understand the behavior, and would appreciate a helping hand.
Use cases
Considering the following template:
Case *1:
If I specialize it in the root namespace via:
I observe that the return value of members_of(^::).size() increments by 1, which is what I expected.
Case *2:
On the other hand, if I do the specialization like this (in the root namespace):
static_assert(is_type(define_aggregate(substitute(^generated_template_test, {std::meta::reflect_value(42)}), {})));
I observe that the return value of members_of(^::).size() does not change, which I find strange, whereas the specialized version of template can be instantiated perfectly well.
Case *3:
Furthermore, if I specialize the template in a namespace (also works with a class):
The situation seems to be perfectly similar to *2.
Questions
This raises the following questions:
A/ Is case *3 allowed (class specialization in a namespace)?
B/ Is it normal for the return of members_of(^::).size() and members_of(^a_namespace).size() not to change once the template has been specialized?
C/ Is there a way to browse all the specializations of a template class?
Thank you for your time, I really appreciate your work.
The text was updated successfully, but these errors were encountered: