std::map::const_iterator template compilation error

前端 未结 3 1128
灰色年华
灰色年华 2020-12-20 00:56

I have a template class that contains a std::map that stores pointers to T which refuses to compile:

template 
class Foo
{
public         


        
3条回答
  •  抹茶落季
    2020-12-20 01:57

    You need typename:

    typename std::map::const_iterator begin() const { return items.begin(); }
    

提交回复
热议问题