<?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[C++17 hat Concepts]]></title><description><![CDATA[<p>Nur so als Info: <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4377.pdf" rel="nofollow">Concepts</a> wurden de-facto in C++17 <a href="https://twitter.com/ericniebler/status/623235598027878400" rel="nofollow">aufgenommen</a>.</p>
<p>Sie sind bereits im GCC-Trunk (<a href="https://gcc.gnu.org/projects/cxx1z.html" rel="nofollow">Status-Page</a>) und können mit <code>-std=c++1z</code> aktiviert werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/333961/c-17-hat-concepts</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 03:48:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/333961.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Aug 2015 16:09:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to C++17 hat Concepts on Thu, 13 Aug 2015 16:09:21 GMT]]></title><description><![CDATA[<p>Nur so als Info: <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4377.pdf" rel="nofollow">Concepts</a> wurden de-facto in C++17 <a href="https://twitter.com/ericniebler/status/623235598027878400" rel="nofollow">aufgenommen</a>.</p>
<p>Sie sind bereits im GCC-Trunk (<a href="https://gcc.gnu.org/projects/cxx1z.html" rel="nofollow">Status-Page</a>) und können mit <code>-std=c++1z</code> aktiviert werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463720</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463720</guid><dc:creator><![CDATA[literweise]]></dc:creator><pubDate>Thu, 13 Aug 2015 16:09:21 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Thu, 13 Aug 2015 16:21:24 GMT]]></title><description><![CDATA[<p>Ich bin kein C++ Experte, was sind Concepts?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463722</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463722</guid><dc:creator><![CDATA[PushButton]]></dc:creator><pubDate>Thu, 13 Aug 2015 16:21:24 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Thu, 13 Aug 2015 16:25:47 GMT]]></title><description><![CDATA[<p>So, es wird Zeit sich mal das gesamte Paper durchzulesen und GCC trunk zu holen <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/2463724</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463724</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Thu, 13 Aug 2015 16:25:47 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Thu, 13 Aug 2015 17:00:11 GMT]]></title><description><![CDATA[<p>PushButton schrieb:</p>
<blockquote>
<p>Ich bin kein C++ Experte, was sind Concepts?</p>
</blockquote>
<p>Vereinfacht ausgedrückt:</p>
<pre><code>template &lt;typename T&gt;
const T&amp; min(T &amp;a, T &amp;b) {...}
</code></pre>
<p>Verlangt, dass T einen entsprechenden operator&lt; hat und führt zu umständlichen Fehlermeldungen, wenn ers nicht hat.<br />
Mit concepts:</p>
<pre><code>template&lt;typename T&gt;
concept bool LessThanComparable()
{
    return requires (T a, T b) {a &lt; b};
}

const LessThanComparable&amp; min(LessThanComparable &amp;a, LessThanComparable &amp;b) {...}
</code></pre>
<p>Hab die aktuelle Syntax jetzt nicht im Kopf, aber sie ermöglichen halt bessere Templates und vermeiden viele SFINAE Tricks.<br />
Und aufrgrund dieser extrem kurzen Syntax, nennt man in C++ Typen auch nicht im CamelCase. :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463729</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463729</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Thu, 13 Aug 2015 17:00:11 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Thu, 13 Aug 2015 18:38:02 GMT]]></title><description><![CDATA[<p>Lässt sich im Prinzip mit interfaces vergleichen, wie man sie aus Java oder php kennt. Einfach ein Werkzeug, um dem Compiler zu sagen, welche Eigenschaft ein Object haben muss.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463755</guid><dc:creator><![CDATA[Bengo]]></dc:creator><pubDate>Thu, 13 Aug 2015 18:38:02 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Thu, 13 Aug 2015 20:07:49 GMT]]></title><description><![CDATA[<p>Bengo schrieb:</p>
<blockquote>
<p>Lässt sich im Prinzip mit interfaces vergleichen, wie man sie aus Java oder php kennt. Einfach ein Werkzeug, um dem Compiler zu sagen, welche Eigenschaft ein Object haben muss.</p>
</blockquote>
<p>Concepts sind so ziemlich genau das Gegenteil. Concepts beruhen auf Compile-Time-Polymorphie, während Java und die Personal Home Page Run-Time-Polymorphie machen ...</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/29873">@Nathan</a>: Ja, so ungefähr, auch wenn die Syntax mittlerweile ein bisschen kompakter ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463770</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463770</guid><dc:creator><![CDATA[literweise]]></dc:creator><pubDate>Thu, 13 Aug 2015 20:07:49 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Fri, 14 Aug 2015 00:02:14 GMT]]></title><description><![CDATA[<p>Wenn man &quot;concept&quot; nicht übersetzt zu &quot;Konzept&quot;, sondern zu &quot;Begriff&quot;, dann hat man schon gewonnen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463795</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463795</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Fri, 14 Aug 2015 00:02:14 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Fri, 14 Aug 2015 00:28:23 GMT]]></title><description><![CDATA[<p>Ich freu mich schon drauf sie auszuprobieren und in den Workflow zu integrieren.<br />
Ist anfänglich erstmal ein bisschen wie ein neues Spielzeug :).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463796</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463796</guid><dc:creator><![CDATA[5cript]]></dc:creator><pubDate>Fri, 14 Aug 2015 00:28:23 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Fri, 14 Aug 2015 05:46:25 GMT]]></title><description><![CDATA[<p>conzepts werden vor allem die Compiler Fehlermeldungen verbessern wenn man einer generischen Funktion die gewisse Anforderungen an die verwendeten Typen stellt Typen Übergibt die diese Anforderungen nicht erfüllen.<br />
Heute bekommt man die Art von Fehlermeldungen die viele jammern lassen, und ein Compiler bringt den ganzen Stack von oben nach unten, der andere von unten nach oben, ...</p>
<p>Was mir gefällt, an dem was ich gesehen habe, ist das Funktionen sich fast selber beschreiben. Man sieht dei Deklaration und weis was erwartet wird.<br />
Stroustrup hatte bei einem Talk den ich auf youtube gesehen habe einige nette Beispiele dabei. Die sahen ein bisschen anders (besser für meinen Geschmack) als die Beispiele im wikipedia, aber mal sehen wie es letztendlich wird</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463804</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463804</guid><dc:creator><![CDATA[kurze_frage]]></dc:creator><pubDate>Fri, 14 Aug 2015 05:46:25 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Fri, 14 Aug 2015 08:04:12 GMT]]></title><description><![CDATA[<p>Danke für die Erklärung, dann kann ich die Begeisterung über dieses neue Feature durchaus verstehen. Ich habe zwar noch nie was mit Templates gemacht, habe aber schon von der schwierigen Fehlersuche durch kryptische Fehlertexte gelesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463808</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463808</guid><dc:creator><![CDATA[PushButton]]></dc:creator><pubDate>Fri, 14 Aug 2015 08:04:12 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Fri, 14 Aug 2015 08:12:48 GMT]]></title><description><![CDATA[<p>Mal eine kurze Frage.<br />
Kann ich dem Concept sagen,dass type T eine function haben muss, mit einer entsprechenden Signatur oder ist das Ganze beschränkt, wie im obigen Beispiel<br />
auf Operatoren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463811</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463811</guid><dc:creator><![CDATA[case]]></dc:creator><pubDate>Fri, 14 Aug 2015 08:12:48 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Fri, 14 Aug 2015 08:28:01 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/106">@volkard</a>: <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="😃"
    /> <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="😃"
    /> <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="😃"
    /><br />
<a href="https://www.c-plusplus.net/forum/p2158260#2158260">https://www.c-plusplus.net/forum/p2158260#2158260</a></p>
<p>volkard schrieb:</p>
<blockquote>
<p>Nexus schrieb:</p>
<blockquote>
<p>krümelkacker schrieb:</p>
<blockquote>
<p>und dann ist auto ja auch nur ein Typ-Platzhalter, der entsprechend dekoriert werden kann:</p>
<pre><code class="language-cpp">vector&lt;auto&gt; blah = myfunction();
</code></pre>
</blockquote>
<p>Ah, das kannte ich ebenfalls nicht. Interessant! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--light_bulb"
      title=":bulb:"
      alt="💡"
    /></p>
</blockquote>
<p>Naja, gcc kennt das auch nicht.<br />
Ist es wirklich erlaubt?</p>
</blockquote>
<p>Ja.</p>
<p>Nathan schrieb:</p>
<blockquote>
<p>Hab die aktuelle Syntax jetzt nicht im Kopf</p>
</blockquote>
<p>So:</p>
<pre><code>template&lt;typename T&gt;
concept bool LessThanComparable = requires (T a, T b) {{a &lt; b} -&gt; bool;}
</code></pre>
<blockquote>
<p>Kann ich dem Concept sagen,dass type T eine function haben muss, mit einer entsprechenden Signatur oder ist das Ganze beschränkt, wie im obigen Beispiel<br />
auf Operatoren?</p>
</blockquote>
<pre><code>template &lt;typename T&gt;
concept bool C = requires (T a, int i, float b) {
    {a.function(i, b)} -&gt; std::string;
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2463814</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463814</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Fri, 14 Aug 2015 08:28:01 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Fri, 14 Aug 2015 08:41:00 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<blockquote>
<p>Kann ich dem Concept sagen,dass type T eine function haben muss, mit einer entsprechenden Signatur oder ist das Ganze beschränkt, wie im obigen Beispiel<br />
auf Operatoren?</p>
</blockquote>
<pre><code>template &lt;typename T&gt;
concept bool C = requires (T a, int i, float b) {
    {a.function(i, b)} -&gt; std::string;
};
</code></pre>
</blockquote>
<p>Wobei das jetzt nicht ganz genau die Signatur prüft. Die Memberfunktion könnte auch als <code>std::string function(float i, float b)</code> deklariert worden denke ich. Schließlich prüft <code>requires</code> nur ob der Ausdruck wohlgeformt ist, aber die Konvertierung int -&gt; float kann implizit passieren (wie noch viele weitere Konvertierungen).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463815</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463815</guid><dc:creator><![CDATA[sebi707]]></dc:creator><pubDate>Fri, 14 Aug 2015 08:41:00 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Fri, 14 Aug 2015 09:00:01 GMT]]></title><description><![CDATA[<p>sebi707 schrieb:</p>
<blockquote>
<p>Wobei das jetzt nicht ganz genau die Signatur prüft.</p>
</blockquote>
<p>Das ist mir klar. Es macht nur einfach nie Sinn die genaue Signatur einer Methode zu prüfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463816</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Fri, 14 Aug 2015 09:00:01 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Fri, 14 Aug 2015 09:33:11 GMT]]></title><description><![CDATA[<p>Na gut, man kann natürlich ganz rustikal anpacken:</p>
<pre><code>template &lt;typename T&gt;
concept bool HasF = requires {
	{&amp;T::f} -&gt; void (T::*)(int);
};
</code></pre>
<p>Ist aber wie gesagt nicht sonderlich nützlich, weil man ja i.d.R. die Funktion aufrufen und nicht per Funktionszeiger irgendwo speichern will.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463820</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Fri, 14 Aug 2015 09:33:11 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Fri, 14 Aug 2015 09:57:33 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<p>Na gut, man kann natürlich ganz rustikal anpacken [...]</p>
</blockquote>
<p>Ah nett. Darauf bin ich jetzt gerade nicht gekommen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2463822</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2463822</guid><dc:creator><![CDATA[sebi707]]></dc:creator><pubDate>Fri, 14 Aug 2015 09:57:33 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Sun, 16 Aug 2015 14:02:03 GMT]]></title><description><![CDATA[<p>Ich hab mir mal den gcc trunk compiliert und etwas mit concepts rumgespielt und bin auf etwas merkwürdiges gestoßen:</p>
<pre><code>int foo(int x)
{
        return 0;
}

template &lt;typename T&gt;
concept bool C = requires (T x) {
        {foo(x)} -&gt; int&amp;;
};

void bar(C x)
{
        //int&amp; y = foo(x);
}

int main()
{
        bar(5);
}
</code></pre>
<p>Ich hätte hier erwartet, dass mein Concept C nicht erfüllt ist weil foo keine Referenz zurück gibt. Stattdessen gibts dann erst einen Fehler wenn ich die Zuweisung <code>int&amp; y = foo(x);</code> auskommentiere. Habe ich etwas falsch verstanden oder wieso funktioniert das nicht?</p>
<p>14.10.1.5 Implicit conversion constraints schrieb:</p>
<blockquote>
<p>An implicit conversion constraint is a constraint that specifies a requirement on the implicit conversion of an expression E to a type T.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2464096</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2464096</guid><dc:creator><![CDATA[sebi707]]></dc:creator><pubDate>Sun, 16 Aug 2015 14:02:03 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Sun, 16 Aug 2015 14:15:02 GMT]]></title><description><![CDATA[<p>Ja, das ist ein Bug. Reporte mal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2464098</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2464098</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Sun, 16 Aug 2015 14:15:02 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Sun, 16 Aug 2015 14:19:34 GMT]]></title><description><![CDATA[<p>Huch. Ich glaub' GCC hat nicht mehr alle Tassen im Schrank:</p>
<pre><code>int foo(int x) 
{ 
        return x; 
} 

template &lt;typename T&gt; 
concept bool C = requires (T x) { 
        {foo(x)} -&gt; void; 
}; 

static_assert( C&lt;int&gt; );
</code></pre>
<p>Das kompiliert gar. Merkwürdig. Dabei ist gar nichts implizit zu <code>void</code> konvertierbar..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2464100</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2464100</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Sun, 16 Aug 2015 14:19:34 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Sun, 16 Aug 2015 18:11:14 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<p>Reporte mal.</p>
</blockquote>
<p>Erledigt: <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67240" rel="nofollow">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67240</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2464141</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2464141</guid><dc:creator><![CDATA[sebi707]]></dc:creator><pubDate>Sun, 16 Aug 2015 18:11:14 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Mon, 17 Aug 2015 08:00:38 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<pre><code>template&lt;typename T&gt;
concept bool LessThanComparable = requires (T a, T b) {{a &lt; b} -&gt; bool;}
</code></pre>
</blockquote>
<p>Mal ne dumme Frage, die Syntax war doch mal etwa so (wenn ich mich richtig erinnere)</p>
<pre><code>template &lt;typename T&gt;
concept bool LessThanComparable
{
    bool operator&lt;(T a, T b); // T braucht einen operator&lt; der 2 T's nimmt und bool zurückgibt
}
</code></pre>
<p>Wieso ist das jetzt so &quot;häßlich&quot; mit <code>=requires</code> und Pfeil für den Rückgabewert? Das <code>concept</code> Schlüsselwort sollte doch ausreichen um dem Compiler zu sagen dass jetzt die requirements für T kommen, gibts einen bestimmten Grund warum man genau die Syntax gewählt hat?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2464213</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2464213</guid><dc:creator><![CDATA[happystudent]]></dc:creator><pubDate>Mon, 17 Aug 2015 08:00:38 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Mon, 17 Aug 2015 08:55:19 GMT]]></title><description><![CDATA[<p>happystudent schrieb:</p>
<blockquote>
<p>Wieso ist das jetzt so &quot;häßlich&quot; mit <code>=requires</code> und Pfeil für den Rückgabewert? Das <code>concept</code> Schlüsselwort sollte doch ausreichen um dem Compiler zu sagen dass jetzt die requirements für T kommen, gibts einen bestimmten Grund warum man genau die Syntax gewählt hat?</p>
</blockquote>
<p>Die neue Version ist allgemeiner. Das alte sagt lediglich, dass der operator &lt; (a, b) vorhanden ist und bool zurueckgibt. Das neue hingegen sagt, dass diue expression a&lt;b gueltig ist und das Ergebnis in boolean umgewandelt werden kann, quasi dass</p>
<pre><code>bool c = a&lt;b
</code></pre>
<p>gueltig ist.<br />
Mehrere requires koennen wahrscheinlich auch mit logischen operatoren verbunden werden.</p>
<p>Ausserdem sieht es vermutlich besser aus, wenn man nicht alles in einer Zeile schreibt:</p>
<pre><code>template&lt;typename T&gt;
concept bool LessThanComparable =
requires (T a, T b) {
    {a &lt; b} -&gt; bool;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2464222</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2464222</guid><dc:creator><![CDATA[Marthog]]></dc:creator><pubDate>Mon, 17 Aug 2015 08:55:19 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Mon, 17 Aug 2015 09:29:44 GMT]]></title><description><![CDATA[<p>Marthog schrieb:</p>
<blockquote>
<p>Die neue Version ist allgemeiner. Das alte sagt lediglich, dass der operator &lt; (a, b) vorhanden ist und bool zurueckgibt. Das neue hingegen sagt, dass diue expression a&lt;b gueltig ist und das Ergebnis in boolean umgewandelt werden kann, quasi dass</p>
<pre><code>bool c = a&lt;b
</code></pre>
<p>gueltig ist.</p>
</blockquote>
<p>Ok, also würde das concept sowohl für eine freie operator-Funktion <code>bool operator&lt;(T a, T b)</code> als auch für eine Member-operator-funktion <code>bool T::operator&lt;(T b)</code> funktionieren? Das ist dann natürlich ein Vorteil der Schreibweise <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2464227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2464227</guid><dc:creator><![CDATA[happystudent]]></dc:creator><pubDate>Mon, 17 Aug 2015 09:29:44 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Mon, 17 Aug 2015 09:57:27 GMT]]></title><description><![CDATA[<p>Marthog schrieb:</p>
<blockquote>
<p>Das neue hingegen sagt, dass diue expression a&lt;b gueltig ist und das Ergebnis in boolean umgewandelt werden kann, quasi dass</p>
<pre><code>bool c = a&lt;b
</code></pre>
<p>gueltig ist.</p>
</blockquote>
<p>Nicht Quasi, sondern genau das.</p>
<blockquote>
<p>Mehrere requires koennen wahrscheinlich auch mit logischen operatoren verbunden werden.</p>
</blockquote>
<p>Ja, siehe §14.10.1.1.</p>
<blockquote>
<p>Ausserdem sieht es vermutlich besser aus, wenn man nicht alles in einer Zeile schreibt:</p>
</blockquote>
<p>Seh' ich nicht so.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2464231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2464231</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 17 Aug 2015 09:57:27 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Mon, 17 Aug 2015 17:50:12 GMT]]></title><description><![CDATA[<p>Ist im aktuellen Concepts Stand auch etwas vorgesehen mit dem man Concepts für bestimmte Typen &quot;zurechtbiegen&quot; kann?</p>
<p>Also wenn ich einen Typ <code>X</code> habe, wo <code>x1 &lt; x2</code> eben nicht compiliert, und ich den trotzdem in einem <code>LessThanComparable</code> -fordernden Template verwenden will.<br />
Kann ich dann eine &quot;Spezialisierung&quot; von <code>LessThanComparable</code> für <code>X</code> schreiben, oder muss ich wirklich &quot;global&quot; dafür sorgen dass <code>x1 &lt; x2</code> eben doch funktioniert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2464314</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2464314</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Mon, 17 Aug 2015 17:50:12 GMT</pubDate></item><item><title><![CDATA[Reply to C++17 hat Concepts on Mon, 17 Aug 2015 19:19:54 GMT]]></title><description><![CDATA[<p>hustbaer schrieb:</p>
<blockquote>
<p>Ist im aktuellen Concepts Stand auch etwas vorgesehen mit dem man Concepts für bestimmte Typen &quot;zurechtbiegen&quot; kann?</p>
<p>Also wenn ich einen Typ <code>X</code> habe, wo <code>x1 &lt; x2</code> eben nicht compiliert, und ich den trotzdem in einem <code>LessThanComparable</code> -fordernden Template verwenden will.<br />
Kann ich dann eine &quot;Spezialisierung&quot; von <code>LessThanComparable</code> für <code>X</code> schreiben, oder muss ich wirklich &quot;global&quot; dafür sorgen dass <code>x1 &lt; x2</code> eben doch funktioniert?</p>
</blockquote>
<p>Macht IMO keinen Sinn. Sahen die Verfasser des Proposals ähnlich:</p>
<p>§7.1.7/7 schrieb:</p>
<blockquote>
<p>A program shall not declare an explicit instantiation (14.8.2), an explicit specialization (14.8.3), or a partial specialization of a concept definition. [ <em>Note</em>: <strong>This prevents users from subverting the constraint system by providing a meaning for a concept that differs from its original definition.</strong> — <em>end note</em> ]</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2464342</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2464342</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 17 Aug 2015 19:19:54 GMT</pubDate></item></channel></rss>