Why does...
class Foo
{
std::list<int> list;
std::map<int, std::list<int>: :iterator> map;
};
...compile, while this...
template<class T> class Foo
{
std::list<T> list;
std::map<int, std::list<T>::i terator> map;
};
...fails with...
/foo.h:129: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map’
/foo.h:129: error: expected a type, got ‘std::list<T*,s td::allocator<T *> >::iterator’
/foo.h:129: error: template argument 4 is invalid
...i thought templates of templates were fine?
Thanks
Nick
class Foo
{
std::list<int> list;
std::map<int, std::list<int>: :iterator> map;
};
...compile, while this...
template<class T> class Foo
{
std::list<T> list;
std::map<int, std::list<T>::i terator> map;
};
...fails with...
/foo.h:129: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map’
/foo.h:129: error: expected a type, got ‘std::list<T*,s td::allocator<T *> >::iterator’
/foo.h:129: error: template argument 4 is invalid
...i thought templates of templates were fine?
Thanks
Nick
Comment