<?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[Geht das mit jedem Std.-konformen Compiler?]]></title><description><![CDATA[<p>Situation:</p>
<pre><code class="language-cpp">struct a
{
    void foo()
    {
    }
    a *operator-&gt;()
    {
        return this;
    }
};

struct b
{
    void bar()
    {
    }
    a operator-&gt;()
    {
        return a();
    }
};

struct c
{
    void qux()
    {
    }
    b operator-&gt;()
    {
        return b();
    }
};

int main()
{
    c cobj;
    cobj-&gt;foo();
    return 0;
}
</code></pre>
<p>Frage steht im Titel :p</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/215029/geht-das-mit-jedem-std-konformen-compiler</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 00:24:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/215029.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 05 Jun 2008 16:08:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Geht das mit jedem Std.-konformen Compiler? on Thu, 05 Jun 2008 16:08:36 GMT]]></title><description><![CDATA[<p>Situation:</p>
<pre><code class="language-cpp">struct a
{
    void foo()
    {
    }
    a *operator-&gt;()
    {
        return this;
    }
};

struct b
{
    void bar()
    {
    }
    a operator-&gt;()
    {
        return a();
    }
};

struct c
{
    void qux()
    {
    }
    b operator-&gt;()
    {
        return b();
    }
};

int main()
{
    c cobj;
    cobj-&gt;foo();
    return 0;
}
</code></pre>
<p>Frage steht im Titel :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1523482</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1523482</guid><dc:creator><![CDATA[alterjunge^^]]></dc:creator><pubDate>Thu, 05 Jun 2008 16:08:36 GMT</pubDate></item><item><title><![CDATA[Reply to Geht das mit jedem Std.-konformen Compiler? on Thu, 05 Jun 2008 19:58:48 GMT]]></title><description><![CDATA[<p>Müsste IMO OK sein, da AFAIK beim 1. nicht überladenen legalen -&gt; abgebrochen wird.<br />
Da a* ein Zeiger ist kommt nach a::operator -&gt; das erst mal der &quot;originale&quot; operator -&gt; dran, über den ist foo erreichbar, passt.</p>
<p>Müsstest du allerdings im Standard nachlesen, ich kenne den genauen Wortlaut auch nicht wie das dort steht.</p>
<p>Comeau Online frisst es zumindest.</p>
<p>Und ... hat die Frage einen bestimmten Grund?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1523656</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1523656</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Thu, 05 Jun 2008 19:58:48 GMT</pubDate></item><item><title><![CDATA[Reply to Geht das mit jedem Std.-konformen Compiler? on Thu, 05 Jun 2008 20:05:38 GMT]]></title><description><![CDATA[<p>der operator -&gt; wird rekursiv auf klassentypen mit überladenem operator-&gt; aufgerufen bis der erste echte Zeigertyp zurückgegeben wird. dies ist auch gültig bei temporären rückgabewerten, da diese erst nach beenden des ausdrucks zerstört werden, und solange haben sie eine gültige addresse.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1523662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1523662</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Thu, 05 Jun 2008 20:05:38 GMT</pubDate></item><item><title><![CDATA[Reply to Geht das mit jedem Std.-konformen Compiler? on Thu, 05 Jun 2008 20:51:47 GMT]]></title><description><![CDATA[<p>bin ich der einzige, der bei solchem code magenschmerzen bekommt? Oo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1523698</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1523698</guid><dc:creator><![CDATA[wuaaah]]></dc:creator><pubDate>Thu, 05 Jun 2008 20:51:47 GMT</pubDate></item><item><title><![CDATA[Reply to Geht das mit jedem Std.-konformen Compiler? on Fri, 06 Jun 2008 07:00:38 GMT]]></title><description><![CDATA[<p>wuaaah schrieb:</p>
<blockquote>
<p>bin ich der einzige, der bei solchem code magenschmerzen bekommt? Oo</p>
</blockquote>
<p>Naja, temporäre Objekte zurückgeben ist immer ein wenig kribbelig, wenn man nicht camper heißt .... aber ansonsten geht der doch (wenn auch &quot;schön&quot; was Anderes ist, aber das soll der Code ja auch nicht sein).</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1523798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1523798</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Fri, 06 Jun 2008 07:00:38 GMT</pubDate></item></channel></rss>