N
Nephi Immortal
Why doesn’t my code work?
Error 3 error C2511: 'void Outer<Outer_Type>::_Type<Type1>::test(void)' : overloaded member function not found in 'Outer<Outer_Type>::_Type<Type1>' d:\main.cpp
enum Types
{
Type1,
Type2
};
template< Types Outer_Type >
struct Outer
{
template< Types Type >
struct _Type;
template<>
struct _Type< Type1 >
{
void test();
};
_Type< Type1 > Do();
};
void Outer< Type1 >::_Type< Type1 >::test()
{
}
Outer< Type1 >::_Type< Type1 > Outer< Type1 >:o()
{
return _Type< Type1 >();
}
int main()
{
Outer< Type1 > x;
x.Do().test();
return 0;
}
Error 3 error C2511: 'void Outer<Outer_Type>::_Type<Type1>::test(void)' : overloaded member function not found in 'Outer<Outer_Type>::_Type<Type1>' d:\main.cpp
enum Types
{
Type1,
Type2
};
template< Types Outer_Type >
struct Outer
{
template< Types Type >
struct _Type;
template<>
struct _Type< Type1 >
{
void test();
};
_Type< Type1 > Do();
};
void Outer< Type1 >::_Type< Type1 >::test()
{
}
Outer< Type1 >::_Type< Type1 > Outer< Type1 >:o()
{
return _Type< Type1 >();
}
int main()
{
Outer< Type1 > x;
x.Do().test();
return 0;
}