Consider the following class template:
template <auto>
struct T {};
- Are two specializations of
T
, where the respective template-argument is a pointer-to-member(1) to two different but same-type members, guaranteed to refer to different specializations ofT
?
(1) pointer to data member or pointer to member function.
Or, applied to the following example:
struct S {
int x;
int y;
void f();
void g();
};
static_assert(std::is_same_v<decltype(&S::x), decltype(&S::y)>);
static_assert(std::is_same_v<decltype(&S::f), decltype(&S::g)>);
- Are the specializations
T<&S::x>
andT<&S::y>
ofT
guaranteed to refer to different specializations ofT
? - Are the specializations
T<&S::f>
andT<&S::g>
ofT
guaranteed to refer to different specializations ofT
?
or, in code, is the following snippet well-formed?
// T and S as above.
static_assert(!std::is_same_v<T<&S::x>, T<&S::y>>);
static_assert(!std::is_same_v<T<&S::f>, T<&S::g>>);