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 2:49

>>23
To be fair, it's only pig shit GCC that bitches about this. MSVC is actually sane about parsing it. I had uhh... let me remember.

for (vector<T>::iterator iter = vec.begin(); iter != vec.end(); ++iter)

MSVC took it like a champ and then GCC whined like the little shitty schoolgirl bitch that it is.

The solution was not vector<typename T> as you might expect, either. It was typename vector<T>. I should be angry at the standard, but seriously, this should BE the standard.

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