0

I have a problem in my Mng.h file like this Error C2146: syntax error : missing ';' before identifier 'it_Data' & val_Data & it_Ref & val_Ref

#include <string>
#include <map>
template <class T> class CMng
{
protected:

typedef std::map<std::string, T*>::iterator     it_Data;
typedef std::map<std::string, T*>::value_type   val_Data;

typedef std::map<T*, int>::iterator             it_Ref;
typedef std::map<T*, int>::value_type           val_Ref;

What could be the problem?

RepahidiS
  • 45
  • 8
  • Does the file include any other headers? – Almo Sep 30 '15 at 13:00
  • Welcome to Stack Overflow! Please **[edit]** your question with an [mcve] or [SSCCE (Short, Self Contained, Correct Example)](http://sscce.org) – NathanOliver Sep 30 '15 at 13:01
  • Don't forget `const_iterator`. And if T is a template, put the typedefs insider the class declaration. – Bathsheba Sep 30 '15 at 13:01
  • 6
    `typedef typename std::map::iterator it_Data;`. See [Where and why do I have to put the “template” and “typename” keywords?](http://stackoverflow.com/questions/610245/where-and-why-do-i-have-to-put-the-template-and-typename-keywords) – cpplearner Sep 30 '15 at 13:11
  • @cpplearner ist working thank you so much :) – RepahidiS Sep 30 '15 at 13:15

0 Answers0