<?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[Liste mit maps sortieren]]></title><description><![CDATA[<p>Moin,<br />
s. Thema, also die <code>list</code> enthält mehrere <code>map &lt; string, string&gt;</code> (key, value) und sortiert werden soll nach einem bestimmten key (title) bitte mal einen kleinen Denkanstoß.</p>
<p>Danke in Vorab und viele Grüße!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/354477/liste-mit-maps-sortieren</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 06:41:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/354477.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Jan 2024 06:58:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 06:58:29 GMT]]></title><description><![CDATA[<p>Moin,<br />
s. Thema, also die <code>list</code> enthält mehrere <code>map &lt; string, string&gt;</code> (key, value) und sortiert werden soll nach einem bestimmten key (title) bitte mal einen kleinen Denkanstoß.</p>
<p>Danke in Vorab und viele Grüße!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619756</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619756</guid><dc:creator><![CDATA[_ro_ro]]></dc:creator><pubDate>Fri, 12 Jan 2024 06:58:29 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 07:52:18 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a> Mir ist nicht klar, wie die Sortierung aussehen soll, kannst du ein Beispiel geben?<br />
<code>std::list</code> hat eine <code>sort</code> Funktion, der du mitgeben kannst, wie sortiert werden soll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619759</guid><dc:creator><![CDATA[Schlangenmensch]]></dc:creator><pubDate>Fri, 12 Jan 2024 07:52:18 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 07:59:24 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a></p>
<p>Ein erster Schritt sollte immer einen Blick in die C++ Referenz sein:</p>
<p><a href="https://en.cppreference.com/w/cpp/container/list/sort" rel="nofollow">https://en.cppreference.com/w/cpp/container/list/sort</a></p>
<p>Die Sortierungsfunktion erlaubt die Angabe einer Vergleichsfunktion. Und diese würde ich ausprobieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619760</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619760</guid><dc:creator><![CDATA[Quiche Lorraine]]></dc:creator><pubDate>Fri, 12 Jan 2024 07:59:24 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 08:34:17 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20667">@Schlangenmensch</a></p>
<p>die Liste ist ein Teil der Konfiguration (BIN) meiner Website. So wird sie erstellt:</p>
<pre><code class="language-cpp">void Folder(Response &amp;r){
    list &lt; map&lt;string,string&gt; &gt; slice;
    for( auto li = r.BIN.begin(); li != r.BIN.end(); li++){
        string url = li-&gt;first;
        map &lt;string,string&gt; hunt = r.BIN[url];
        if( hunt[&quot;parent&quot;].compare(r.URL) == 0 ){
            hunt[&quot;url&quot;] = url;
            slice.push_back(hunt);
        }
    }
    r.LOOPS[&quot;children&quot;] = slice; 
}
</code></pre>
<p>Die map (hunt) hat mehrere name/value Paare wie title, descr. Damit wird ein Template gerendert, das Ergebnis ist HTML: <a href="http://rolfrost.de/cpp.chtml" rel="nofollow">http://rolfrost.de/cpp.chtml</a><br />
und das soll nach title sortiert werden.</p>
<p>MFG</p>
<p>Nur zum Verständnis, das Template</p>
<pre><code class="language-plain">&lt;dl&gt;
  `loop_children`
    &lt;dt class='file'&gt;  &lt;a href=&quot;`url`&quot; class=&quot;outlink&quot;&gt; `title` &lt;/a&gt;  &lt;/dt&gt;
    &lt;dd&gt; `descr` &lt;/dd&gt;
  `endloop` 
&lt;/dl&gt;    
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2619761</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619761</guid><dc:creator><![CDATA[_ro_ro]]></dc:creator><pubDate>Fri, 12 Jan 2024 08:34:17 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 08:21:26 GMT]]></title><description><![CDATA[<p>Generell, ohne weiter auf deinen Code einzugehen:<br />
Verwende std::vector statt std::list. Vector ist eine Art Array mit Größenangabe, das automatisch wachsen kann, während list eine verkettete Liste ist. List habe ich tatsächlich noch nie produktiv benutzt, da vector praktisch immer besser ist. (Ich habe aber nicht weiter auf deinen Code geguckt, da kommt mir mehr komisch vor, u.a. vermute ich, dass BIN auch ne map ist, aber dann könntest du second für den map-Wert nutzen statt über eckige Klammern first nachzugucken. Siehe außerdem <a href="https://en.cppreference.com/w/cpp/language/structured_binding" rel="nofollow">https://en.cppreference.com/w/cpp/language/structured_binding</a> um first/second gleich lesbar zu machen)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619762</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619762</guid><dc:creator><![CDATA[wob]]></dc:creator><pubDate>Fri, 12 Jan 2024 08:21:26 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 08:42:45 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a> Erstmal denke ich, dass, wie <a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/33261">@wob</a> geschrieben hat, ein Vektor oder direkt eine Map besser geeignet ist.</p>
<p>Was das sortieren betrifft, wenn ich dich richtig verstanden habe:</p>
<pre><code class="language-cpp"> std::sort(
   std::begin(slice), 
   std::end(slice), 
   [](const map&lt;string,string&gt;&amp; a, const map&lt;string, string&gt;&amp; b)
   {
      return a[&quot;title&quot;] &lt; b[&quot;title&quot;];
   }
);
</code></pre>
<p>bzw, ich würde</p>
<pre><code class="language-cpp">std::sort(
  std::begin(slice), 
  std::end(slice), 
  [](const auto&amp; a, const auto&amp; b)
     {
        return a[&quot;title&quot;] &lt; b[&quot;title&quot;];
     }
);
</code></pre>
<p>Unabhängig davon, ob slice jetzt eine <code>list</code> oder ein <code>vector</code>ist.</p>
<p>Ich habe das gerade aber nicht getestet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619763</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619763</guid><dc:creator><![CDATA[Schlangenmensch]]></dc:creator><pubDate>Fri, 12 Jan 2024 08:42:45 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 08:47:57 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20667">@Schlangenmensch</a></p>
<p>danke Dir,</p>
<pre><code class="language-plain">C:\var\www\vhosts\rolfrost.de\httpdocs\cgi-bin\fw.cpp: In lambda function:
C:\var\www\vhosts\rolfrost.de\httpdocs\cgi-bin\fw.cpp:588:31: error: passing 'const std::map&lt;std::__cxx11::basic_string&lt;char&gt;, std::__cxx11::basic_string&lt;char&gt; &gt;' as 'this' argument discards qualifiers [-fpermissive]
               return a[&quot;title&quot;] &lt; b[&quot;title&quot;];
                               ^
In file included from c:\mingw6.2\lib\gcc\mingw32\6.3.0\include\c++\map:61:0,
                 from C:\var\www\vhosts\rolfrost.de\httpdocs\cgi-bin\fw.cpp:9:
c:\mingw6.2\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_map.h:494:7: note:   in call to 'std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::mapped_type&amp; std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::operator[](std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::key_type&amp;&amp;) [with _Key = std::__cxx11::basic_string&lt;char&gt;; _Tp = std::__cxx11::basic_string&lt;char&gt;; _Compare = std::less&lt;std::__cxx11::basic_string&lt;char&gt; &gt;; _Alloc = std::allocator&lt;std::pair&lt;const std::__cxx11::basic_string&lt;char&gt;, std::__cxx11::basic_string&lt;char&gt; &gt; &gt;; std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::mapped_type = std::__cxx11::basic_string&lt;char&gt;; std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::key_type = std::__cxx11::basic_string&lt;char&gt;]'
       operator[](key_type&amp;&amp; __k)
       ^~~~~~~~

</code></pre>
<p>entweder fehlt eine <code>#include &lt;???&gt;</code> oder meine C++ Version 201402 gibt das nicht her.</p>
<p>Viele Grüße!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619764</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619764</guid><dc:creator><![CDATA[_ro_ro]]></dc:creator><pubDate>Fri, 12 Jan 2024 08:47:57 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 08:51:18 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a> nutze <a href="http://map.at" rel="nofollow">map.at</a> statt map[], weil die eckigen Klammern die map ändern können, passen sie nicht mit const zusammen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619765</guid><dc:creator><![CDATA[wob]]></dc:creator><pubDate>Fri, 12 Jan 2024 08:51:18 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:12:02 GMT]]></title><description><![CDATA[<p>Hups, was <a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/33261">@wob</a> sagt. Und, <code>std::sort</code> ist im Header <code>&lt;algorithm&gt;</code></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619766</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619766</guid><dc:creator><![CDATA[Schlangenmensch]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:12:02 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:13:40 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/33261">@wob</a></p>
<p>ich verstehe nur Bahnhof. Also ich habe jetzt eine dedizierte sort-Funktion</p>
<pre><code class="language-cpp">bool title_sort(map&lt;string,string&gt;&amp; a, map&lt;string, string&gt;&amp; b){
    return a[&quot;title&quot;] &lt; b[&quot;title&quot;];    
}
</code></pre>
<p>Aber wenn ich sie aufrufe <code>sort(slice.begin(), slice.end(), title_sort);</code> gibts jede Menge Fehlermeldungen</p>
<pre><code class="language-plain">In file included from c:\mingw6.2\lib\gcc\mingw32\6.3.0\include\c++\algorithm:62:0,
                 from c:\mingw6.2\lib\gcc\mingw32\6.3.0\include\c++\regex:38,
                 from C:\var\www\vhosts\rolfrost.de\httpdocs\cgi-bin\fw.cpp:18:
c:\mingw6.2\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algo.h: In instantiation of 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::_List_iterator&lt;std::map&lt;std::__cxx11::basic_string&lt;char&gt;, std::__cxx11::basic_string&lt;char&gt; &gt; &gt;; _Compare = __gnu_cxx::__ops::_Iter_comp_iter&lt;bool (*)(std::map&lt;std::__cxx11::basic_string&lt;char&gt;, std::__cxx11::basic_string&lt;char&gt; &gt;&amp;, std::map&lt;std::__cxx11::basic_string&lt;char&gt;, std::__cxx11::basic_string&lt;char&gt; &gt;&amp;)&gt;]':
c:\mingw6.2\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algo.h:4739:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = std::_List_iterator&lt;std::map&lt;std::__cxx11::basic_string&lt;char&gt;, std::__cxx11::basic_string&lt;char&gt; &gt; &gt;; _Compare = bool (*)(std::map&lt;std::__cxx11::basic_string&lt;char&gt;, std::__cxx11::basic_string&lt;char&gt; &gt;&amp;, std::map&lt;std::__cxx11::basic_string&lt;char&gt;, std::__cxx11::basic_string&lt;char&gt; &gt;&amp;)]'
C:\var\www\vhosts\rolfrost.de\httpdocs\cgi-bin\fw.cpp:588:48:   required from here
c:\mingw6.2\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algo.h:1966:22: error: no match for 'operator-' (operand types are 'std::_List_iterator&lt;std::map&lt;std::__cxx11::basic_string&lt;char&gt;, std::__cxx11::basic_string&lt;char&gt; &gt; &gt;' and 'std::_List_iterator&lt;std::map&lt;std::__cxx11::basic_string&lt;char&gt;, std::__cxx11::basic_string&lt;char&gt; &gt; &gt;')
     std::__lg(__last - __first) * 2,
               ~~~~~~~^~~~~~~~~
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2619767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619767</guid><dc:creator><![CDATA[_ro_ro]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:13:40 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:20:58 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a> sagte in <a href="/forum/post/2619767">Liste mit maps sortieren</a>:</p>
<blockquote>
<p>ich verstehe nur Bahnhof.</p>
</blockquote>
<p>Du darfst nicht <code>a[&quot;title&quot;] &lt; b[&quot;title&quot;]</code> schreiben, sondern musst <code>a.at(&quot;title&quot;) &lt; b.at(&quot;title&quot;)</code> schreiben.</p>
<blockquote>
<p>Also ich habe jetzt eine dedizierte sort-Funktion</p>
</blockquote>
<p>Edit: Ach, ich hatte gehofft, du hättest schon auf vector statt list umgestellt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619768</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619768</guid><dc:creator><![CDATA[wob]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:20:58 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:19:27 GMT]]></title><description><![CDATA[<p>Für eine <code>list&lt;...&gt;</code> funktioniert <a href="https://de.cppreference.com/w/cpp/algorithm/sort" rel="nofollow">std::sort</a> nicht (anders als <a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20667">@Schlangenmensch</a>  geschrieben hat), denn es verlangt einen <code>RandomAccessIterator</code> (also direkten Indexzugriff), daher hat diese eine eigene <a href="https://de.cppreference.com/w/cpp/container/list/sort" rel="nofollow">sort</a> Funktion.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619769</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619769</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:19:27 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:21:36 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/33261">@wob</a> sagte in <a href="/forum/post/2619762">Liste mit maps sortieren</a>:</p>
<blockquote>
<p>...<br />
Verwende std::vector statt std::list.<br />
...</p>
</blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a><br />
Das solltest du wirklich tun.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619770</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619770</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:21:36 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:23:51 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/18927">@DocShoe</a></p>
<p>ne, da muss ich ja meine ganze Template-Klasse ändern. Aber wenn <code>list</code> schon eine eigene Sortierfunktion hat, muß es doch möglich sein, nach &quot;title&quot; sortieren zu können. In Perl ist das eine einzige Zeile seufz.</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619771</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619771</guid><dc:creator><![CDATA[_ro_ro]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:23:51 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:29:03 GMT]]></title><description><![CDATA[<p>Oooops, kaum macht mans richtig</p>
<pre><code class="language-cpp">bool title_sort(map&lt;string,string&gt;&amp; a, map&lt;string, string&gt;&amp; b){
    return a[&quot;title&quot;] &gt; b[&quot;title&quot;];    
}
void Folder(Response &amp;r){
    list &lt; map&lt;string,string&gt; &gt; slice;
    for( auto li = r.BIN.begin(); li != r.BIN.end(); li++){
        string url = li-&gt;first;
        map &lt;string,string&gt; hunt = r.BIN[url];
        if( hunt[&quot;parent&quot;].compare(r.URL) == 0 ){
            hunt[&quot;url&quot;] = url;
            slice.push_back(hunt);
        }
    }
    slice.sort(title_sort);
    r.LOOPS[&quot;children&quot;] = slice; 
}
</code></pre>
<p>Isses das auch? Wenn ich den Vergleichsoperator rumdrehe. wird auch andersherum sortiert.</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619772</guid><dc:creator><![CDATA[_ro_ro]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:29:03 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:33:03 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a><br />
In C++ auch:</p>
<pre><code class="language-c++">slice.sort( []( const map&lt;string,string&gt;&amp; lhs, const map&lt;string, string&gt;&amp; rhs ) { return lhs.at( &quot;title&quot; ) &lt; rhs.at( &quot;title&quot; ); } );
</code></pre>
<p>Edit 1<br />
Waren wir vorhin nicht sogar schon bei const-correctness?</p>
<p>Edit 2<br />
<a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/33261">@wob</a> ouch, fixed</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619773</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619773</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:33:03 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:34:19 GMT]]></title><description><![CDATA[<p><code>at</code> ist eine Funktion und braucht runde Klammern. Edit: ist oben schon gefixt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619774</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619774</guid><dc:creator><![CDATA[wob]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:34:19 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 12:36:56 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/33261">@wob</a></p>
<p>Ahh, danke!!! Und danke Euch!</p>
<p>Viele Grüße <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>PS: Daß list eine sort-Methode hat war der entscheidende Hinweis!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619775</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619775</guid><dc:creator><![CDATA[_ro_ro]]></dc:creator><pubDate>Fri, 12 Jan 2024 12:36:56 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:39:25 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a> sagte in <a href="/forum/post/2619771">Liste mit maps sortieren</a>:</p>
<blockquote>
<p>ne, da muss ich ja meine ganze Template-Klasse ändern.</p>
</blockquote>
<p>slice wird doch nur lokal benutzt, wieso musst du dann alles ändern?</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a> sagte in <a href="/forum/post/2619771">Liste mit maps sortieren</a>:</p>
<blockquote>
<p>Aber wenn <code>list</code> schon eine eigene Sortierfunktion hat, muß es doch möglich sein, nach &quot;title&quot; sortieren zu können. In Perl ist das eine einzige Zeile seufz.</p>
</blockquote>
<p>Du hast dich nun mal entschieden, das in C++ zu machen. Das Gejammere, dass es in &lt;hier beliebige Programmiersprache einsetzen&gt; einfacher, besser oder schneller geht hilft keinem weiter. Wenn es in anderen Programmiersprachen besser, schneller oder einfacher geht, warum machst du dann C++?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619776</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619776</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:39:25 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:45:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/18927">@DocShoe</a> sagte in <a href="/forum/post/2619776">Liste mit maps sortieren</a>:</p>
<blockquote>
<p>slice wird doch nur lokal benutzt</p>
</blockquote>
<p>Ja schon.  Aber meine <code>Templating::Loop</code> funktioniert nunmal auch nur mit bestimmten Datentypen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Im Übrigen hat meine Anmerkung mit Jammern nicht das Geringste zu tun.</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619777</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619777</guid><dc:creator><![CDATA[_ro_ro]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:45:09 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:48:45 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a></p>
<p>Ouch, ja, sehe grad, dass du die in <code>r</code> einsetzt. Du solltest dir trotzdem überlegen, ob du das nicht trotzdem überarbeiten möchtest. <code>std::vector</code> ist der Wald- und Wiesen-Sequence-Container in C++, man sollte schon gute Gründe haben, stattdessen einen anderen Containertyp zu benutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619778</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619778</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:48:45 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 09:50:10 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/18594">@Th69</a> Argh... <code>std::list</code> gehört zu den Containern, mit denen ich tatsächlich noch nie gearbeitet habe, man sollte halt doch alles einmal in nen Compiler jagen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619779</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619779</guid><dc:creator><![CDATA[Schlangenmensch]]></dc:creator><pubDate>Fri, 12 Jan 2024 09:50:10 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 10:02:59 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/38431">@_ro_ro</a> sagte in <a href="/forum/post/2619777">Liste mit maps sortieren</a>:</p>
<blockquote>
<p>Ja schon.  Aber meine Templating::Loop funktioniert nunmal auch nur mit bestimmten Datentypen</p>
</blockquote>
<ol>
<li>
<p>Du hast dich aus irgendeinem Grund für std::list entschieden. Das ist in 99,9% der Fälle eine schlechte Wahl. Was sprach gegen std::vector?</p>
</li>
<li>
<p>Wenn du doch nur Iterieren willst, kannst du einfach einen Iterator (ggf. als Template) als Argument nehmen.  Dann kannst du in deiner Template-Loop über alles iterieren, was iterierbar ist.</p>
</li>
</ol>
]]></description><link>https://www.c-plusplus.net/forum/post/2619780</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619780</guid><dc:creator><![CDATA[wob]]></dc:creator><pubDate>Fri, 12 Jan 2024 10:02:59 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 10:16:48 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20667">@Schlangenmensch</a></p>
<p>ein Webframework (kurz Framework, FW) in C++ entwickeln ist Pionierarbeit. Ich frage mich ob das überhaupt schonmal jemand gemacht hat. Entscheidend fürs Gelingen ist in allererster Linie die Idee wie man das ganze umsetzt also die Architektur. Und es ist der ganze Aufbau der nach einer objektorientierten PL förmlich schreit. Dieses FW habe ich nicht an einen Tag entwickelt sondern über mehrere Jahre .<br />
Erst mit der stückweisen Umsetzung mit Perl wuchs die Idee, dies auch mit anderen PLs zu tun, insbesondere mit der Frage inwieweit man das objektorientiert machen kann. Denn das ganze FW ist objektorientiert aufgebaut.<br />
Ergo ist der Gedanke, das in C++ zu machen sehr naheliegend.  Und das bisherige Ergebnis kann sich sehen lassen aber sowas von.</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619782</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619782</guid><dc:creator><![CDATA[_ro_ro]]></dc:creator><pubDate>Fri, 12 Jan 2024 10:16:48 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 10:19:39 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/33261">@wob</a> sagte in <a href="/forum/post/2619780">Liste mit maps sortieren</a>:</p>
<blockquote>
<ol>
<li>Du hast dich aus irgendeinem Grund für std::list entschieden. Das ist in 99,9% der Fälle eine schlechte Wahl. Was sprach gegen std::vector?</li>
</ol>
</blockquote>
<p>Weil das in Perl auch list heißt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Und die Annahme, dass das schon iwie das gleiche sein wird.<br />
SCNR</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619783</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619783</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Fri, 12 Jan 2024 10:19:39 GMT</pubDate></item><item><title><![CDATA[Reply to Liste mit maps sortieren on Fri, 12 Jan 2024 10:34:41 GMT]]></title><description><![CDATA[<p>Da gibt es schon so einige:</p>
<ul>
<li><a href="https://drogon.org/" rel="nofollow">Drogon</a></li>
<li><a href="https://github.com/oatpp/oatpp" rel="nofollow">Oat++</a></li>
<li><a href="https://de.wikipedia.org/wiki/Wt_(Web_Toolkit)" rel="nofollow">Wt (Web-Toolkit)</a></li>
</ul>
<p>s.a. <a href="https://www.linuxlinks.com/free-open-source-cplusplus-web-frameworks/" rel="nofollow">9 Top Free and Open Source C++ Web Frameworks</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2619784</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2619784</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Fri, 12 Jan 2024 10:34:41 GMT</pubDate></item></channel></rss>