<?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 mit typedef]]></title><description><![CDATA[<p>hallo.<br />
es geht um das folgende reduzierte beispiel:</p>
<pre><code>template&lt;typename T&gt;
struct Base
{
	typedef T Type;
};

template&lt;typename T&gt;
struct Derive : T
{
};

template&lt;typename T&gt;
struct Foo : Derive&lt;Base&lt;T&gt; &gt;
{
	Type Bar;
};

int main()
{
}
</code></pre>
<p><a href="http://ideone.com/9jPKsq" rel="nofollow">http://ideone.com/9jPKsq</a></p>
<p>es kompiliert nicht mit der meldung:</p>
<pre><code>prog.cpp:15:2: error: ‘Type’ does not name a type
  Type Bar;
  ^
</code></pre>
<p>ich verstehe nicht wieso das nicht geht, es ist aber auch möglich dass es trivial ist und ich im moment vollkommen blind bin. kann mir bitte jemand auf die sprünge helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/326461/problem-mit-typedef</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 23:47:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/326461.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Jun 2014 15:15:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to problem mit typedef on Thu, 19 Jun 2014 15:15:26 GMT]]></title><description><![CDATA[<p>hallo.<br />
es geht um das folgende reduzierte beispiel:</p>
<pre><code>template&lt;typename T&gt;
struct Base
{
	typedef T Type;
};

template&lt;typename T&gt;
struct Derive : T
{
};

template&lt;typename T&gt;
struct Foo : Derive&lt;Base&lt;T&gt; &gt;
{
	Type Bar;
};

int main()
{
}
</code></pre>
<p><a href="http://ideone.com/9jPKsq" rel="nofollow">http://ideone.com/9jPKsq</a></p>
<p>es kompiliert nicht mit der meldung:</p>
<pre><code>prog.cpp:15:2: error: ‘Type’ does not name a type
  Type Bar;
  ^
</code></pre>
<p>ich verstehe nicht wieso das nicht geht, es ist aber auch möglich dass es trivial ist und ich im moment vollkommen blind bin. kann mir bitte jemand auf die sprünge helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404583</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404583</guid><dc:creator><![CDATA[Fytch]]></dc:creator><pubDate>Thu, 19 Jun 2014 15:15:26 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit typedef on Thu, 19 Jun 2014 15:26:56 GMT]]></title><description><![CDATA[<p>In der Basis wird nicht nicht gesucht. Ist ein Klassiker.<br />
Du musst ihn explizit auffordern da zu suchen.<br />
EDIT: Kurz Weil: wegen dem Templateargument</p>
<p>Eine Möglichkeit war glaube ich 'typename Base&lt;T&gt;::Type'</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404587</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404587</guid><dc:creator><![CDATA[5cript]]></dc:creator><pubDate>Thu, 19 Jun 2014 15:26:56 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit typedef on Thu, 19 Jun 2014 15:33:11 GMT]]></title><description><![CDATA[<p>nur weil die klasse aus einem klassentemplate instanziiert wurde? dass das bei nicht-template-klassen geht solange der bezeichner nicht überdeckt wird war mir klar, dieser merkwürdige spezialfall ist mir jedoch neu. wie wird das begründet?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404588</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404588</guid><dc:creator><![CDATA[Fytch]]></dc:creator><pubDate>Thu, 19 Jun 2014 15:33:11 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit typedef on Thu, 19 Jun 2014 15:42:36 GMT]]></title><description><![CDATA[<p><a href="https://www.google.de/search?&amp;q=two%20phase%20lookup" rel="nofollow">Google: two phase lookup</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404589</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Thu, 19 Jun 2014 15:42:36 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit typedef on Thu, 19 Jun 2014 15:48:35 GMT]]></title><description><![CDATA[<p>EDIT: zu spät</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404593</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404593</guid><dc:creator><![CDATA[5cript]]></dc:creator><pubDate>Thu, 19 Jun 2014 15:48:35 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit typedef on Thu, 19 Jun 2014 15:55:59 GMT]]></title><description><![CDATA[<blockquote>
<p>In the definition of a class or class template, if a base class depends on a <em>template-parameter</em>, the base class scope is not examined during unqualified name lookup either at the point of definition of the class template or member or during an instantiation of the class template or member.</p>
</blockquote>
<blockquote>
<p>wie wird das begründet?</p>
</blockquote>
<p>Es kann noch (explizite oder partielle) Spezialisierungen des Basisklassentemplates <code>Derived</code> geben, von denen der Compiler zum Zeitpunkt der Definition von <code>Foo</code> noch nichts weiß.<br />
Da könnte <code>Type</code> auch als ein statischer Member deklariert sein, und nicht einen Typen benennen!</p>
<p>Außerdem: Wenn du direkt von einem Template-Parameter ableitest, kann man offensichtlich zum Zeitpunkt der Definition eines Klassentemplates nichts über die Basisklasse wissen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404595</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Thu, 19 Jun 2014 15:55:59 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit typedef on Thu, 19 Jun 2014 16:21:39 GMT]]></title><description><![CDATA[<p>ach man, wie offensichtlich es eigentlich ist... dennoch bin ich nicht darauf gekommen. danke für die hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404603</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404603</guid><dc:creator><![CDATA[Fytch]]></dc:creator><pubDate>Thu, 19 Jun 2014 16:21:39 GMT</pubDate></item></channel></rss>