I'm trying my very first template. the following code compiles :
template<class T,class C=int> class MyClass
{};
But not this :
#include <vector>
using namespace std;
template<class T,class C=vector<T>> class MyClass
{};
Yet i see the standard vector class template declared like this :
template < class T, class Alloc=allocator<T> > class vector
{};
The errors the compiler throws are :
*error: spurious '>>', use '>' to terminate a template argument list
*error: definition of 'class MyClass' inside template parameter list
*error: two or more data types in declaration of 'type name'
*error: expected '>' before ';' token
*error: expected unqualified-id before ';' token
std::beforevector.