I have a template class that contains a std::map
that stores pointers to T which refuses to compile:
template
class Foo
{
public
Use typename
:
typename std::map::const_iterator begin() const ...
When this is first passed by the compiler, it doesn't know what T
is. Thus, it also doesn't know wether const_iterator
is actually a type or not.
Such dependent names (dependent on a template parameter) are assumed to
typename
template
.