C++ map problem

12/19/2012 12:17 Ancientsword#1
Ich hoffe das ihr mir weiter helfen könnt.

Ich habe momentan diesen Compiler Error

Code:
IntelliSense: no instance of overloaded function "std::map<_Kty, _Ty, _Pr, _Alloc>::insert [with _Kty=std::string, _Ty=int, _Pr=std::less<std::string>, _Alloc=std::allocator<std::pair<const std::string, int>>]" matches the argument list
            argument types are: (std::pair<ATL::CStringT<char, StrTraitMFC<char, ATL::ChTraitsCRT<char>>>, int>)
            object type is: std::map<std::string, int, std::less<std::string>, std::allocator<std::pair<const std::string, int>>>
Code:
Error    140    error C2228: left of '.second' must have class/struct/union

Und komme einfach nicht vorran.

Fehler tritt in dieser If Funktion auf....

Code:
if( m_defines.insert( make_pair( Token, eNum ) ).second == false )
Die Definition der map:

Code:
std::map<string, int> CScript::m_defines;
Und die Deklaration der map:

Code:
static map<string, int>        m_defines;
Ist im Public Bereich.

EDIT: Hab es so beheben können.

if( m_defines.insert( make_pair( (string)Token, eNum ) ).second == false )

Jedoch bin ich mir nicht sicher ob die Methode nun farlässig oder ok war.