Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 14:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



C++ map problem

Discussion on C++ map problem within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2010
Posts: 294
Received Thanks: 85
C++ map problem

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.
Ancientsword is offline  
Reply


Similar Threads Similar Threads
[Problem]Habe ein Problem und zwar spinnt mein VPC etwas(ohne Grund)?!
07/28/2011 - Metin2 Private Server - 10 Replies
Also wie schon gesagt meins Server spinnt wodurch kiks usw. kommen :( ich lade euch die Screens in den Anhang, mit der Hoffnung, dass ihr mir helfen könnt :) wäre echt sehr nice :)



All times are GMT +2. The time now is 14:43.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.