Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Sepplesfags, help!

Name: Anonymous 2008-12-08 18:34


template <class T>
class A
{
public:
    typedef T Foo;
};

template <class T>
class B
{
    A<T>::Foo foo;
};

int main()
{
    B<int> b;
    return 0;
}



test.cpp:11: error: type ‘A<T>’ is not derived from type ‘B<T>’
test.cpp:11: error: expected ‘;’ before ‘foo’


What the FUCK?

Name: Anonymous 2009-11-30 1:05

>>25
I have ruminated for a while before posting, and I have decided that the following is ambiguous without typename:

T::id();

Is that constructing a temporary value of type T::id, or calling a static member function T::id? Bear in mind that the compiler doesn't know what T is at this point, so it can't just look at T and decide.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List