<?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[Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen?]]></title><description><![CDATA[<p>Ich habe eine Funktion, die bei gleibem Übergabewert auch immer dasselbe zurückliefert. Wenn es eine memberfunktion wäre, würde man das ja mit const auszeichnen.</p>
<p>Wie mache ich das bei Funktionen? constexpr geht ja nur, wenn die Funktion inline ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/319363/funktion-mit-konstantem-rückgabewert-bei-konstanter-übergabe-wie-kennzeichnen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Jul 2026 05:16:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/319363.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Aug 2013 16:21:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen? on Thu, 15 Aug 2013 16:21:08 GMT]]></title><description><![CDATA[<p>Ich habe eine Funktion, die bei gleibem Übergabewert auch immer dasselbe zurückliefert. Wenn es eine memberfunktion wäre, würde man das ja mit const auszeichnen.</p>
<p>Wie mache ich das bei Funktionen? constexpr geht ja nur, wenn die Funktion inline ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2346122</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2346122</guid><dc:creator><![CDATA[dsdf]]></dc:creator><pubDate>Thu, 15 Aug 2013 16:21:08 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen? on Thu, 15 Aug 2013 16:34:24 GMT]]></title><description><![CDATA[<p>dsdf schrieb:</p>
<blockquote>
<p>Wenn es eine memberfunktion wäre, würde man das ja mit const auszeichnen.</p>
</blockquote>
<p>Nein, eine Funktion die const ist kann trotzdem noch auf globale / statische Variablen zugreifen. Was du suchst klingt mehr nach einem Qualifizierer wie &quot;pure&quot;, aber so etwas hat C++ leider nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2346126</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2346126</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Thu, 15 Aug 2013 16:34:24 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen? on Thu, 15 Aug 2013 16:35:21 GMT]]></title><description><![CDATA[<p>dsdf schrieb:</p>
<blockquote>
<p>Wenn es eine memberfunktion wäre, würde man das ja mit const auszeichnen.</p>
</blockquote>
<p>Häh? Nein. const bei Memberfunktionen hat eine ganz andere Bedeutung.</p>
<blockquote>
<p>Wie mache ich das bei Funktionen? constexpr geht ja nur, wenn die Funktion inline ist.</p>
</blockquote>
<p>Mit constexpr. Wo ist denn der Sinn solch einer Kennzeichnung, wenn die Funktion nicht auch inline ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2346127</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2346127</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 15 Aug 2013 16:35:21 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen? on Thu, 15 Aug 2013 16:36:17 GMT]]></title><description><![CDATA[<p>Wenn dann mit einem Kommentar. Warum moechtest du sie ueberhaupt besonders kennzeichnen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2346128</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2346128</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Thu, 15 Aug 2013 16:36:17 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen? on Thu, 15 Aug 2013 16:38:41 GMT]]></title><description><![CDATA[<p>Deine Funktion ist nicht speziell, <em>jede</em> C++-Funktion ist prinzipiell erstmal seiteneffektfrei. Alles was davon abweicht soll speziell kommentiert werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2346129</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2346129</guid><dc:creator><![CDATA[kennerderzeichner]]></dc:creator><pubDate>Thu, 15 Aug 2013 16:38:41 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen? on Thu, 15 Aug 2013 16:41:31 GMT]]></title><description><![CDATA[<p>kennerderzeichner schrieb:</p>
<blockquote>
<p>Deine Funktion ist nicht speziell, <em>jede</em> C++-Funktion ist prinzipiell erstmal seiteneffektfrei. Alles was davon abweicht soll speziell kommentiert werden.</p>
</blockquote>
<p>Bloß weil es so sein sollte, heißt nicht, dass es so ist. Im Zweifelsfall ist immer davon auszugehen, dass eine Funktion Nebeneffekte hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2346130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2346130</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 15 Aug 2013 16:41:31 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen? on Thu, 15 Aug 2013 16:42:57 GMT]]></title><description><![CDATA[<p>cooky451 schrieb:</p>
<blockquote>
<p>dsdf schrieb:</p>
<blockquote>
<p>Wenn es eine memberfunktion wäre, würde man das ja mit const auszeichnen.</p>
</blockquote>
<p>Nein, eine Funktion die const ist kann trotzdem noch auf globale / statische Variablen zugreifen. Was du suchst klingt mehr nach einem Qualifizierer wie &quot;pure&quot;, aber so etwas hat C++ leider nicht.</p>
</blockquote>
<p>Danke, mit dem g++ geht __attribute__ ((pure))</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2346131</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2346131</guid><dc:creator><![CDATA[sdfs]]></dc:creator><pubDate>Thu, 15 Aug 2013 16:42:57 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen? on Thu, 15 Aug 2013 16:50:19 GMT]]></title><description><![CDATA[<p>Lustig, ich wusste nicht mal dass GCC so ein Feature hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2346134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2346134</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Thu, 15 Aug 2013 16:50:19 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen? on Thu, 15 Aug 2013 16:51:29 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Bloß weil es so sein sollte, heißt nicht, dass es so ist. Im Zweifelsfall ist immer davon auszugehen, dass eine Funktion Nebeneffekte hat.</p>
</blockquote>
<p>Beispiel?<br />
Bei Funktionen für externe Ressourcen ist das offensichtlich, bei allen anderen sollte es nicht so sein.</p>
<p>Denn globaler State sollte prinzipiell vermieden werden. Und ich rede hier von beobachtbaren Nebeneffekten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2346135</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2346135</guid><dc:creator><![CDATA[kennerderzeichner]]></dc:creator><pubDate>Thu, 15 Aug 2013 16:51:29 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit konstantem Rückgabewert bei konstanter Übergabe: Wie kennzeichnen? on Fri, 16 Aug 2013 21:00:22 GMT]]></title><description><![CDATA[<p>kennerderzeichner schrieb:</p>
<blockquote>
<p>SeppJ schrieb:</p>
<blockquote>
<p>Bloß weil es so sein sollte, heißt nicht, dass es so ist. Im Zweifelsfall ist immer davon auszugehen, dass eine Funktion Nebeneffekte hat.</p>
</blockquote>
<p>Beispiel?<br />
Bei Funktionen für externe Ressourcen ist das offensichtlich, bei allen anderen sollte es nicht so sein.</p>
</blockquote>
<p>Achja jetzt auf einmal. Erst war es noch *jede* C++ Funktion.<br />
Und mal ganz davon abgesehen dass du &quot;ist&quot; mit &quot;sollte sein&quot; durcheinander bringst.<br />
Und dass du &quot;seiteneffektfrei&quot; mit &quot;pure&quot; verwechselst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2346546</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2346546</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Fri, 16 Aug 2013 21:00:22 GMT</pubDate></item></channel></rss>