<?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++frage(bessere Schreibform)]]></title><description><![CDATA[<p>Hallo,<br />
ich will eine Klasse mit dem = operator überladen.<br />
Welche Schreibform ist die bessere?</p>
<pre><code class="language-cpp">class foo 
{
...
const foo&amp; operator = (const foo &amp;next){...}//erste Variante  
...
foo&amp; operator = (const foo &amp;next){...}//zweite V.
</code></pre>
<p>Also die Frage ist,mit const oder ohne?...Beides funktioniert.<br />
Kann man dass erste const vor der Referenceklasse foo weglassen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/149606/c-frage-bessere-schreibform</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 07:40:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/149606.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Jun 2006 16:45:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to c++frage(bessere Schreibform) on Wed, 07 Jun 2006 16:45:51 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich will eine Klasse mit dem = operator überladen.<br />
Welche Schreibform ist die bessere?</p>
<pre><code class="language-cpp">class foo 
{
...
const foo&amp; operator = (const foo &amp;next){...}//erste Variante  
...
foo&amp; operator = (const foo &amp;next){...}//zweite V.
</code></pre>
<p>Also die Frage ist,mit const oder ohne?...Beides funktioniert.<br />
Kann man dass erste const vor der Referenceklasse foo weglassen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073315</guid><dc:creator><![CDATA[cico2006]]></dc:creator><pubDate>Wed, 07 Jun 2006 16:45:51 GMT</pubDate></item><item><title><![CDATA[Reply to c++frage(bessere Schreibform) on Wed, 07 Jun 2006 16:56:51 GMT]]></title><description><![CDATA[<p>Wenn du sowas machen willst</p>
<pre><code class="language-cpp">foo a,b,c;
a = b = c = irgendeinwert;
</code></pre>
<p>darfst du keine konstante Referenz zurückliefern.</p>
<p>cico2006 schrieb:</p>
<blockquote>
<p>Welche Schreibform ist die bessere?</p>
</blockquote>
<p>IMHO die ohne const, damit du im oben genannten Fall das gleiche Verhalten wie für primitive Typen hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073322</guid><dc:creator><![CDATA[michba]]></dc:creator><pubDate>Wed, 07 Jun 2006 16:56:51 GMT</pubDate></item><item><title><![CDATA[Reply to c++frage(bessere Schreibform) on Wed, 07 Jun 2006 17:14:51 GMT]]></title><description><![CDATA[<p>-predator- schrieb:</p>
<blockquote>
<p>Wenn du sowas machen willst</p>
<pre><code class="language-cpp">foo a,b,c;
a = b = c = irgendeinwert;
</code></pre>
<p>darfst du keine konstante Referenz zurückliefern.</p>
<p>cico2006 schrieb:</p>
<blockquote>
<p>Welche Schreibform ist die bessere?</p>
</blockquote>
<p>IMHO die ohne const, damit du im oben genannten Fall das gleiche Verhalten wie für primitive Typen hast.</p>
</blockquote>
<p>Danke für die schnelle Antwort!...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073331</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073331</guid><dc:creator><![CDATA[cico2006]]></dc:creator><pubDate>Wed, 07 Jun 2006 17:14:51 GMT</pubDate></item></channel></rss>