template<typename T> struct S {};
template<typename T> struct R {};
int main() {
typedef S<double> s1;
typedef S<int> s2;
typedef R<int> s3;
static_assert(xxx<s1, s2>::value,
"No, assertion must not be raised");
static_assert(xxx<s2, s3>::value,
"Yes, assertion must be raised");
}
Tak, chcę xxx<s1, s2>::value
wrócić prawda podczas xxx<s2, s3>::value
do return false podczas kompilacji.uzyskać oryginalną nazwę struct/klasy C++ szablonu podczas konkretyzacji
Czy istnienie xxx jest niemożliwe w C++? Czy istnienie xxx jest teoretycznie możliwe w C++, ale prawdopodobnie nikt tego jeszcze nie zrobił?
Więc 'xxx :: wartość' to 'prawda' iff' T' i 'U' to specjalizacje tego samego szablonu? –
Quentin
@Quentin: tak :) –