<?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[basisklasse]]></title><description><![CDATA[<p>hi<br />
wenn ich von einem klassen-template ableite, dann kann ich auf dessen member nur zugreifen wenn ich den basisklassentypen davor schreibe:</p>
<pre><code>template&lt;class T&gt;
struct base
{
    typedef T type;
};
template&lt;class T&gt;
struct derived : public base&lt;T&gt;
{
    base&lt;T&gt;::type myvar;
};
</code></pre>
<p>nun fällt sofort ins auge, dass ich hier base&lt;T&gt; zweimal schreibe. lässt sich das irgendwie verhindern?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/321136/basisklasse</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 01:12:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/321136.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 25 Oct 2013 08:44:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to basisklasse on Fri, 25 Oct 2013 08:44:27 GMT]]></title><description><![CDATA[<p>hi<br />
wenn ich von einem klassen-template ableite, dann kann ich auf dessen member nur zugreifen wenn ich den basisklassentypen davor schreibe:</p>
<pre><code>template&lt;class T&gt;
struct base
{
    typedef T type;
};
template&lt;class T&gt;
struct derived : public base&lt;T&gt;
{
    base&lt;T&gt;::type myvar;
};
</code></pre>
<p>nun fällt sofort ins auge, dass ich hier base&lt;T&gt; zweimal schreibe. lässt sich das irgendwie verhindern?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2362787</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2362787</guid><dc:creator><![CDATA[reducer]]></dc:creator><pubDate>Fri, 25 Oct 2013 08:44:27 GMT</pubDate></item><item><title><![CDATA[Reply to basisklasse on Fri, 25 Oct 2013 08:57:21 GMT]]></title><description><![CDATA[<p>Jain, du kannst dir ein Typedef in die (ableitende) Klasse machen und dieses dann weiter nutzen. So hast du dann exakt 2 mal das gleiche geschrieben, aber dafür nicht noch öfters.</p>
<p>Edit: Also so</p>
<pre><code>template&lt;class T&gt;
struct base
{
    typedef T type;
};
template&lt;class T&gt;
struct derived : public base&lt;T&gt;
{
    typedef base&lt;T&gt;::type MyType;
    MyType myvar;
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2362790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2362790</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Fri, 25 Oct 2013 08:57:21 GMT</pubDate></item><item><title><![CDATA[Reply to basisklasse on Fri, 25 Oct 2013 08:57:57 GMT]]></title><description><![CDATA[<p>Skym0sh0 schrieb:</p>
<blockquote>
<p>Jain, du kannst dir ein Typedef in die (ableitende) Klasse machen und dieses dann weiter nutzen. So hast du dann exakt 2 mal das gleiche geschrieben, aber dafür nicht noch öfters.</p>
</blockquote>
<p>ja das hab ich mir auch schon überlegt, jedoch sind zwei mal immer noch mehr als ein mal...<br />
nagut, muss ich mich halt damit abfinden, danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2362791</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2362791</guid><dc:creator><![CDATA[reducer]]></dc:creator><pubDate>Fri, 25 Oct 2013 08:57:57 GMT</pubDate></item></channel></rss>