<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Probleme mit Map..]]></title><description><![CDATA[<p>Hallo, will eine Map mit eindeutigen Schlüssel als std:string, jeder schlüssel enthält eine liste !</p>
<p>Beim einfügen eine listenelements mit entsprechenden key, muss gecheckt werden ob key schon existiert. Wenn nein key erstellen und eelemnt in liste anfügen!</p>
<p>Aber komm damit nich zurecht..</p>
<pre><code class="language-cpp">//MAP mit Liste
std::map&lt;std::string,std::list&lt;UINT&gt; &gt; m_Groups;

//anfügen
void addMod(std::string strGroup,UINT iModul){

		//Wenn Schlüssel nich gefunden wurde, dann anlegen
		if(m_Groups.find(strGroup) == m_Groups.end())
			m_Groups.insert(std::pair&lt;strGroup,iModul);

		//Anfügen 
		m_Groups[strGroup].push_back(iModul);

	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/193239/probleme-mit-map</link><generator>RSS for Node</generator><lastBuildDate>Sun, 27 Sep 2026 19:48:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/193239.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 24 Sep 2007 09:22:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 09:22:19 GMT]]></title><description><![CDATA[<p>Hallo, will eine Map mit eindeutigen Schlüssel als std:string, jeder schlüssel enthält eine liste !</p>
<p>Beim einfügen eine listenelements mit entsprechenden key, muss gecheckt werden ob key schon existiert. Wenn nein key erstellen und eelemnt in liste anfügen!</p>
<p>Aber komm damit nich zurecht..</p>
<pre><code class="language-cpp">//MAP mit Liste
std::map&lt;std::string,std::list&lt;UINT&gt; &gt; m_Groups;

//anfügen
void addMod(std::string strGroup,UINT iModul){

		//Wenn Schlüssel nich gefunden wurde, dann anlegen
		if(m_Groups.find(strGroup) == m_Groups.end())
			m_Groups.insert(std::pair&lt;strGroup,iModul);

		//Anfügen 
		m_Groups[strGroup].push_back(iModul);

	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1371431</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371431</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Mon, 24 Sep 2007 09:22:19 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 09:26:14 GMT]]></title><description><![CDATA[<p>Was funktioniert daran denn nicht? Und ich glaube du musst einen Schlüssel nicht anlegen, der wird beim ersten Zugriff darauf angelegt. Also kannst du imho den &quot;//Wenn Schlüssel nich gefunden wurde, dann anlegen&quot;-Teil weglassen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371433</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Mon, 24 Sep 2007 09:26:14 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 09:31:04 GMT]]></title><description><![CDATA[<p>Ich glaube du meinst sowas:</p>
<pre><code class="language-cpp">std::map&lt;std::string, std::list&lt;UINT&gt; &gt;:: iterator it;
it = m_Groups.find(strGroup);
if(it == m_Groups.end())
   m_Groups[strGroup] = std::list&lt;UINT&gt;();
it-&gt;second.push_back(iModul);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1371436</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371436</guid><dc:creator><![CDATA[megaweber]]></dc:creator><pubDate>Mon, 24 Sep 2007 09:31:04 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 09:31:46 GMT]]></title><description><![CDATA[<p>Es kommen tausend &quot;error C2784:&quot; 'bool std::operator &lt;(const............</p>
<p>Fehler und</p>
<p>c:\Programme\Microsoft Visual Studio .NET 2003\Vc7\include\functional(139): error C2676: binary '&lt;' : 'const std::string' does not define this operator or a conversion to a type acceptable to the predefined operator</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371438</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371438</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Mon, 24 Sep 2007 09:31:46 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 09:32:24 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;string&gt;
</code></pre>
<p>vergessen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371439</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371439</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 24 Sep 2007 09:32:24 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 09:33:15 GMT]]></title><description><![CDATA[<p>da kommen die gleichen fehler;)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371442</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Mon, 24 Sep 2007 09:33:15 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 09:35:45 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">m_Groups.insert(std::pair&lt;strGroup,iModul);
</code></pre>
<p>Mir fällt da ein &lt; anstatt einer ( auf...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371443</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371443</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Mon, 24 Sep 2007 09:35:45 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 09:36:00 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/2803">@MFK</a>: ohman .. aber echt.. dachte ich hab schon irgendwo anders string verwendet:) Das kommt davon wenn man an mehren projekten gleichzeit arbeitet;)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371444</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371444</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Mon, 24 Sep 2007 09:36:00 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 09:36:08 GMT]]></title><description><![CDATA[<p>Das hier wird bei mir ohne Fehler kompiliert:</p>
<pre><code class="language-cpp">#include &lt;map&gt;
#include &lt;list&gt;
#include &lt;string&gt;

typedef unsigned int UINT;

std::map&lt;std::string,std::list&lt;UINT&gt; &gt; m_Groups;

//anfügen
void addMod(std::string strGroup,UINT iModul)
{
    //Anfügen
    m_Groups[strGroup].push_back(iModul);
}

int main()
{
}
</code></pre>
<p>Kannst du ein Minimalbeispiel liefern, das deinen Fehler reproduziert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371445</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371445</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 24 Sep 2007 09:36:08 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 09:38:00 GMT]]></title><description><![CDATA[<blockquote>
<pre><code class="language-cpp">m_Groups.insert(std::pair&lt;strGroup,iModul);
</code></pre>
</blockquote>
<p>Die Zeile ist ein einziger Syntax-Fehler - wenn du std::pair verwendest, mußt du dahinter auch die Typen angeben (in &lt;...&gt; Klammern) - alternativ könntest du auch make_pair nehmen. Und eine implizite Umwandlung von int nach list&lt;int&gt; gibt es auch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371448</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 24 Sep 2007 09:38:00 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Map.. on Mon, 24 Sep 2007 10:01:38 GMT]]></title><description><![CDATA[<p>danke jung;) MFK hatte recht mit dem std::string vergessen;) es klappt wunder bar THX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371471</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371471</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Mon, 24 Sep 2007 10:01:38 GMT</pubDate></item></channel></rss>