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 2008-12-09 8:07

What the fuck is the difference between template <class T> and template <typename T>. If there is no difference, WHY SUPPORT BOTH FOR FUCK'S SHIT?. Backwards compatibility is not good enough an answer.

typename A<T>::Foo foo;
PIG DISGUSTING. A<T>::Foo is already a god damn class. What does the compiler need the typename for?

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