#include
//Primary template
template struct ClassOf {
};
// Partial specialisation
template
struct ClassOf {
using type = Class;};
//An alias
template< typename T> using ClassOf_t = typename ClassOf::type;
struct A {
struct B {
void methodB () {}
};
B* myPtr;
// Rename the function to BB() and do this as well on L29 and the code will compile
B* B() { return myPtr; } //
Подробнее здесь: [url]https://stackoverflow.com/questions/78651000/compile-error-in-stdis-same-v-when-using-a-type-nested-in-a-class-that-contain[/url]
Это не дубликат функции и структуры с одинаковым именем в c++ Приведенный ниже код завершается с ошибкой: [code]error C2923: 'std::is_same_v': 'A::B' is not a valid template type argument for parameter '' [/code] [code]#include
//Primary template template struct ClassOf { };
// Partial specialisation template struct ClassOf { using type = Class;};
//An alias template< typename T> using ClassOf_t = typename ClassOf::type;
struct A { struct B { void methodB () {}
}; B* myPtr; // Rename the function to BB() and do this as well on L29 and the code will compile B* B() { return myPtr; } //