<?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[Problem Vererbung]]></title><description><![CDATA[<p>Ich habe eine <strong>abstrakte</strong> Klasse <em>Request</em>, von dieser Klasse erben zwei Klassen <em>A</em> und <em>B</em>.</p>
<p>Dazu habe ich eine Funktion die ein Objekt vom Typ <em>Request</em> zurückgibt (natürlich gebe ich innerhalb der Funktion entweder ein Objekt vom Typ <em>A</em> oder <em>B</em> zurück). Allerdings sagt mir der Compiler, dass meine Funktionsdeklaration falsch ist, da ich kein Objekt einer abstrakten Klasse zurückgeben darf.</p>
<p>Was kann man da tricksen?</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/326804/problem-vererbung</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 15:42:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/326804.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 Jul 2014 10:55:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem Vererbung on Tue, 08 Jul 2014 10:55:35 GMT]]></title><description><![CDATA[<p>Ich habe eine <strong>abstrakte</strong> Klasse <em>Request</em>, von dieser Klasse erben zwei Klassen <em>A</em> und <em>B</em>.</p>
<p>Dazu habe ich eine Funktion die ein Objekt vom Typ <em>Request</em> zurückgibt (natürlich gebe ich innerhalb der Funktion entweder ein Objekt vom Typ <em>A</em> oder <em>B</em> zurück). Allerdings sagt mir der Compiler, dass meine Funktionsdeklaration falsch ist, da ich kein Objekt einer abstrakten Klasse zurückgeben darf.</p>
<p>Was kann man da tricksen?</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2407551</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2407551</guid><dc:creator><![CDATA[sdgsdhgos]]></dc:creator><pubDate>Tue, 08 Jul 2014 10:55:35 GMT</pubDate></item><item><title><![CDATA[Reply to Problem Vererbung on Tue, 08 Jul 2014 10:59:57 GMT]]></title><description><![CDATA[<p>Ich würd nicht tricksen. Machs einfach richtig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2407552</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2407552</guid><dc:creator><![CDATA[ScottZhang]]></dc:creator><pubDate>Tue, 08 Jul 2014 10:59:57 GMT</pubDate></item><item><title><![CDATA[Reply to Problem Vererbung on Tue, 08 Jul 2014 11:00:58 GMT]]></title><description><![CDATA[<p>Gib einen Verweis auf das Objekt zurück. Das heißt bspw. eine Referenz oder einen Zeiger.</p>
<p>Falls du das Objekt per new alloziert hast, dann gib am besten gleich einen <a href="http://stackoverflow.com/questions/106508/what-is-a-smart-pointer-and-when-should-i-use-one" rel="nofollow">Smart-Pointer</a> zurück.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2407553</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2407553</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Tue, 08 Jul 2014 11:00:58 GMT</pubDate></item><item><title><![CDATA[Reply to Problem Vererbung on Tue, 08 Jul 2014 11:02:29 GMT]]></title><description><![CDATA[<p>Das ist aber garkein tricksen, Arcoth <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2407554</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2407554</guid><dc:creator><![CDATA[ScottZhang]]></dc:creator><pubDate>Tue, 08 Jul 2014 11:02:29 GMT</pubDate></item></channel></rss>