<?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[std::map mehrere Werte für einen Key]]></title><description><![CDATA[<p>Hi,</p>
<p>weiß jmd ob man bei einer std::map auch mehrere Werte auf einen Key platzieren kann? Ich bräuchte zu einem Key insgesamt drei Werte</p>
<pre><code>std::map&lt;string, string, string, int&gt;test;
</code></pre>
<p>In Visual Studio wird mir kein Fehler aufgezeigt beim Compilieren, allerdings weiß ich nicht wie man auf die einezelnen Werte jetzt zugreift, bzw. diese setzen kann.</p>
<p>Gruß<br />
Konrad</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/274489/std-map-mehrere-werte-für-einen-key</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 14:10:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/274489.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Sep 2010 10:09:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to std::map mehrere Werte für einen Key on Mon, 27 Sep 2010 10:09:35 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>weiß jmd ob man bei einer std::map auch mehrere Werte auf einen Key platzieren kann? Ich bräuchte zu einem Key insgesamt drei Werte</p>
<pre><code>std::map&lt;string, string, string, int&gt;test;
</code></pre>
<p>In Visual Studio wird mir kein Fehler aufgezeigt beim Compilieren, allerdings weiß ich nicht wie man auf die einezelnen Werte jetzt zugreift, bzw. diese setzen kann.</p>
<p>Gruß<br />
Konrad</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1957955</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1957955</guid><dc:creator><![CDATA[Konrad Bauer]]></dc:creator><pubDate>Mon, 27 Sep 2010 10:09:35 GMT</pubDate></item><item><title><![CDATA[Reply to std::map mehrere Werte für einen Key on Mon, 27 Sep 2010 10:22:12 GMT]]></title><description><![CDATA[<p>Du kannst dir doch eine Struktur oder Klasse bauen, dafür sind die da. Beispiel:</p>
<pre><code class="language-cpp">struct multi_value
{
    string v1;
    string v2;
    int v3;
};

map&lt;string, multi_value&gt; test;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1957961</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1957961</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Mon, 27 Sep 2010 10:22:12 GMT</pubDate></item><item><title><![CDATA[Reply to std::map mehrere Werte für einen Key on Mon, 27 Sep 2010 10:22:28 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>Das geht so nicht, der dritte Templateparameter hat eine andere Bedeutung. Was möchtest Du denn erreichen? Einen zweistufigen Index? Dafür brauchst Du dann zwei Maps, evtl. hilft Dir aber auch eine Hashmap, so was wie unordered_map von boost.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1957962</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1957962</guid><dc:creator><![CDATA[Eisflamme]]></dc:creator><pubDate>Mon, 27 Sep 2010 10:22:28 GMT</pubDate></item><item><title><![CDATA[Reply to std::map mehrere Werte für einen Key on Mon, 27 Sep 2010 10:26:30 GMT]]></title><description><![CDATA[<p>Mach dir eine eigene Klasse und nutz diese als den value</p>
<pre><code class="language-cpp">class data
{
public:
  string str1;
  string str2;
  int somevalue;
};

.
.
.
std::map&lt;string, data&gt; test;
</code></pre>
<p>ETA: Artchi war schneller <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1957963</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1957963</guid><dc:creator><![CDATA[antialias]]></dc:creator><pubDate>Mon, 27 Sep 2010 10:26:30 GMT</pubDate></item><item><title><![CDATA[Reply to std::map mehrere Werte für einen Key on Mon, 27 Sep 2010 10:29:04 GMT]]></title><description><![CDATA[<p>das mit der Klasse gefällt mir sehr gut - vielen Dank für eure Tipps!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1957966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1957966</guid><dc:creator><![CDATA[Konrad Bauer]]></dc:creator><pubDate>Mon, 27 Sep 2010 10:29:04 GMT</pubDate></item><item><title><![CDATA[Reply to std::map mehrere Werte für einen Key on Mon, 27 Sep 2010 11:49:37 GMT]]></title><description><![CDATA[<p>Alternativ:</p>
<pre><code class="language-cpp">std::map&lt;std::string, std::list&lt;std::string&gt; &gt;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1958007</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1958007</guid><dc:creator><![CDATA[theliquidwave]]></dc:creator><pubDate>Mon, 27 Sep 2010 11:49:37 GMT</pubDate></item></channel></rss>