<?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[Map of Maps]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich versuche gerade eine map von maps zu erstellen. Funktioniert auch aber ich weiß nicht wie ich die Werte ändern kann:</p>
<pre><code>std::map&lt;std::string, std::map&lt;std::string, KLASSE&gt; &gt; testMap;
</code></pre>
<p>Im Netz finde ich bislang noch keine Lösung die mir weiterhilft, oder ich verstehs einfach nicht genau.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/333817/map-of-maps</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 11:37:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/333817.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 02 Aug 2015 16:16:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Map of Maps on Sun, 02 Aug 2015 16:16:56 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich versuche gerade eine map von maps zu erstellen. Funktioniert auch aber ich weiß nicht wie ich die Werte ändern kann:</p>
<pre><code>std::map&lt;std::string, std::map&lt;std::string, KLASSE&gt; &gt; testMap;
</code></pre>
<p>Im Netz finde ich bislang noch keine Lösung die mir weiterhilft, oder ich verstehs einfach nicht genau.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2462110</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2462110</guid><dc:creator><![CDATA[Shor-ty]]></dc:creator><pubDate>Sun, 02 Aug 2015 16:16:56 GMT</pubDate></item><item><title><![CDATA[Reply to Map of Maps on Sun, 02 Aug 2015 16:25:57 GMT]]></title><description><![CDATA[<p>Was ist dein konkretes Problem?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2462113</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2462113</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Sun, 02 Aug 2015 16:25:57 GMT</pubDate></item><item><title><![CDATA[Reply to Map of Maps on Sun, 02 Aug 2015 16:26:56 GMT]]></title><description><![CDATA[<p>Welchen Wert willst du wie ändern?</p>
<p>Allgemein ist da dran überhaupt nichts besonderes, auf die äußere Map greifst du wie gewohnt zu. Das was du erhältst ist dann auch eine Map. Und auf die greifst du dann auch wie gewohnt zu. Je nachdem, wie du den Zugriff genau gestaltest, sind die beiden Zugriffe auch direkt verschachtelbar.</p>
<p>Beispiel, beide Male via operator[] zugegriffen:</p>
<pre><code>testMap[&quot;foo&quot;][&quot;bar&quot;] = irgendwas;  // ändert das &quot;bar&quot;te Element in der &quot;foo&quot;ten Map in testMap.
</code></pre>
<p>Entsprechend mit allen möglichen anderen Zugriffsmethoden, die ich aber nicht alle zeigen werde, oder mit Mischungen davon.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2462114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2462114</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 02 Aug 2015 16:26:56 GMT</pubDate></item><item><title><![CDATA[Reply to Map of Maps on Sun, 02 Aug 2015 17:22:32 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>genau das wollte ich machen:</p>
<pre><code>map&lt;string, map&lt;unsigned int, Klasse&gt; &gt; foobar;

foobar[&quot;test&quot;][3] = Klasse(arg1, arg2, arg3);
</code></pre>
<p>Allerdings geht das bei mir nicht und wir mit folgendem Fehler quittiert, mit dem ich nichts anfangen kann:</p>
<pre><code>268:34: error: use of deleted function 'AFC::MixtureFraction&amp; AFC::MixtureFraction::operator=(const AFC::MixtureFraction&amp;)'
                 flame[&quot;test&quot;][1] = MixtureFraction(chemistry, thermo, transport, properties, zPointValue);
                                  ^
In file included from automaticFlameletCreator.cpp:34:0:
/home/shorty/OpenFOAM/development/flameletcreator/src/mixtureFraction/mixtureFraction.hpp:53:7: note: 'AFC::MixtureFraction&amp; AFC::MixtureFraction::operator=(const AFC::MixtureFraction&amp;)' is implicitly deleted because the default definition would be ill-formed:
 class MixtureFraction
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2462121</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2462121</guid><dc:creator><![CDATA[Shor-ty]]></dc:creator><pubDate>Sun, 02 Aug 2015 17:22:32 GMT</pubDate></item><item><title><![CDATA[Reply to Map of Maps on Sun, 02 Aug 2015 17:38:35 GMT]]></title><description><![CDATA[<p>Die Fehlermeldung sagt dir, dass dein Copy-Assignment-Operator nicht existiert/gelöscht wurde (use of deleted function). Da in der Map beim Zugriff auf ein nicht-existentes Element erstmal der Speicherplatz für die Value erstellt werden muss, wird ein &quot;AFC::MixtureFraction&quot; für dich erstellt, anschließend per = das objekt welches du selbst dort speichern willst hineinkopiert. Versuch es mit std::move, falls du einen move-assignment-operator implementiert hast, weiß leider grade nicht ob die map auch ein equivalent zu 'emplace_back' hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2462123</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2462123</guid><dc:creator><![CDATA[tkausl]]></dc:creator><pubDate>Sun, 02 Aug 2015 17:38:35 GMT</pubDate></item><item><title><![CDATA[Reply to Map of Maps on Sun, 02 Aug 2015 17:48:38 GMT]]></title><description><![CDATA[<p>Es ist übrigens deutlich performanter - vorausgesetzt du willst nur zwei Keys, was ich annehme - wenn du eine map&lt;pair&lt;string, unsigned&gt;, Klasse&gt; verwendest.</p>
<p>Und ja, std::map hat emplace, wenn auch komisch zu nutzen:</p>
<pre><code>foobar[&quot;test&quot;].emplace(std::piecewise_construct, std::forward_as_tuple(3), std::forward_as_tuple(arg1, arg2, arg3))
</code></pre>
<p>Siehe hier: <a href="http://en.cppreference.com/w/cpp/container/map/emplace" rel="nofollow">http://en.cppreference.com/w/cpp/container/map/emplace</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2462127</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2462127</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Sun, 02 Aug 2015 17:48:38 GMT</pubDate></item><item><title><![CDATA[Reply to Map of Maps on Sun, 02 Aug 2015 17:49:50 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>also via Move bekomm ich den gleichen Fehler.<br />
Ich werde mir das anschauen, danke für die Antworten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2462129</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2462129</guid><dc:creator><![CDATA[Shor-ty]]></dc:creator><pubDate>Sun, 02 Aug 2015 17:49:50 GMT</pubDate></item><item><title><![CDATA[Reply to Map of Maps on Sun, 02 Aug 2015 18:06:29 GMT]]></title><description><![CDATA[<p>insert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2462133</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2462133</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 02 Aug 2015 18:06:29 GMT</pubDate></item></channel></rss>