I have a template class that contains a std::map that stores pointers to T which refuses to compile:
template
class Foo
{
public
You need:
typename std::map::const_iterator begin() const { return items.begin(); }
Or simpler
typedef typename std::map::const_iterator const_iterator;
const_iterator begin() const { return items.begin(); }
This is because const_iterator is dependent name on T so you need to tell compiler that it is actually type.