<?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[Wozu zus. &amp;quot;typename&amp;quot; in Template-Klasse-Definition?]]></title><description><![CDATA[<p>Hallo,<br />
kann mir wer sagen, wann man ein extra &quot;typename&quot; in der Definition einer Template-Klasse braucht?<br />
Ich habe das öfters gesehen, weiß aber nicht wozu das gut sein soll:</p>
<pre><code>template&lt;typename T&gt;
class c
{

    typename xyz ...

};
</code></pre>
<p>LG<br />
ULong</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/334129/wozu-zus-quot-typename-quot-in-template-klasse-definition</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 00:58:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/334129.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 24 Aug 2015 06:32:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wozu zus. &amp;quot;typename&amp;quot; in Template-Klasse-Definition? on Mon, 24 Aug 2015 06:32:36 GMT]]></title><description><![CDATA[<p>Hallo,<br />
kann mir wer sagen, wann man ein extra &quot;typename&quot; in der Definition einer Template-Klasse braucht?<br />
Ich habe das öfters gesehen, weiß aber nicht wozu das gut sein soll:</p>
<pre><code>template&lt;typename T&gt;
class c
{

    typename xyz ...

};
</code></pre>
<p>LG<br />
ULong</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2465297</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2465297</guid><dc:creator><![CDATA[ULong]]></dc:creator><pubDate>Mon, 24 Aug 2015 06:32:36 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu zus. &amp;quot;typename&amp;quot; in Template-Klasse-Definition? on Mon, 24 Aug 2015 06:39:42 GMT]]></title><description><![CDATA[<p>Brauchst du nur bei namedependet namelookup, also z.B.:</p>
<pre><code>template &lt;typename T&gt; void func()
{
    typename T::asdf var = 5;
}
</code></pre>
<p>Der Grund dafür ist wohl einfach, weil es im Standard steht, der Microsoft C++ Compiler verlangt typename z.B. nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2465298</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2465298</guid><dc:creator><![CDATA[Mr.L]]></dc:creator><pubDate>Mon, 24 Aug 2015 06:39:42 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu zus. &amp;quot;typename&amp;quot; in Template-Klasse-Definition? on Mon, 24 Aug 2015 06:42:10 GMT]]></title><description><![CDATA[<p>Zum Thema name dependent:<br />
<a href="http://en.cppreference.com/w/cpp/language/dependent_name" rel="nofollow">http://en.cppreference.com/w/cpp/language/dependent_name</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2465300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2465300</guid><dc:creator><![CDATA[Mr.L]]></dc:creator><pubDate>Mon, 24 Aug 2015 06:42:10 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu zus. &amp;quot;typename&amp;quot; in Template-Klasse-Definition? on Mon, 24 Aug 2015 07:32:13 GMT]]></title><description><![CDATA[<p>[quote=§14.6.2]A name used in a template declaration or definition and that is dependent on a template-parameter is assumed not to name a type unless the applicable name lookup finds a type name or the name is qualified by the keyword typename.[/quote]<br />
und<br />
[quote=§14.6.3]When a qualified-id is intended to refer to a type that is not a member of the current instantiation (14.6.2.1) and its nested-name-specifier depends on a template-parameter (14.6.2), it shall be prefixed by the keyword<br />
typename, forming a typename-specifier. If the qualified-id in a typename-specifier does not denote a type, the program is ill-formed.[/quote]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2465303</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2465303</guid><dc:creator><![CDATA[Mr.L]]></dc:creator><pubDate>Mon, 24 Aug 2015 07:32:13 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu zus. &amp;quot;typename&amp;quot; in Template-Klasse-Definition? on Mon, 24 Aug 2015 08:25:41 GMT]]></title><description><![CDATA[<p>Ich hab glaub nen Fehler drin. Das heißt &quot;argument dependet namelookup&quot; anstelle von &quot;name dependet namelookup&quot; und &quot;dependet names&quot; anstelle von &quot;name dependet&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2465309</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2465309</guid><dc:creator><![CDATA[Mr.L]]></dc:creator><pubDate>Mon, 24 Aug 2015 08:25:41 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu zus. &amp;quot;typename&amp;quot; in Template-Klasse-Definition? on Mon, 24 Aug 2015 15:28:22 GMT]]></title><description><![CDATA[<p>..Ok, Danke Mr.L!<br />
Mr. Google korrigiert einen eh sofort..</p>
<p>Habs auf Anhieb ehrlich gesagt nicht wirklich verstanden. Wenn du dafür etwas Zeit hättest, könntest du mir dann ein Negativ-Bsp. geben? Sowas wie &quot;So gehts nicht, darum muss man...&quot;</p>
<p>LG<br />
Ulong</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2465383</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2465383</guid><dc:creator><![CDATA[ULong]]></dc:creator><pubDate>Mon, 24 Aug 2015 15:28:22 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu zus. &amp;quot;typename&amp;quot; in Template-Klasse-Definition? on Mon, 24 Aug 2015 16:06:23 GMT]]></title><description><![CDATA[<p>ULong schrieb:</p>
<blockquote>
<p>Habs auf Anhieb ehrlich gesagt nicht wirklich verstanden. Wenn du dafür etwas Zeit hättest, könntest du mir dann ein Negativ-Bsp. geben? Sowas wie &quot;So gehts nicht, darum muss man...&quot;</p>
</blockquote>
<pre><code>template &lt;typename T&gt; void foo()
{
  T::bar * b;  // Definition eines Pointers oder eine Multiplikation?
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2465396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2465396</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 24 Aug 2015 16:06:23 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu zus. &amp;quot;typename&amp;quot; in Template-Klasse-Definition? on Mon, 24 Aug 2015 16:15:13 GMT]]></title><description><![CDATA[<p>Sobald ein typename von einem Argument abhängt, benötigst du ein typename.<br />
Im Fall von</p>
<pre><code>template &lt;typename T&gt; void func()
{
    typename T::asdf var = 5;
}
</code></pre>
<p>hängt asdf vom Argument T ab, weshalb du ein typename brauchst.<br />
Wärend hier:</p>
<pre><code>struct A { typedef int asdf; };
void func()
{
    A::asdf var = 5;
}
</code></pre>
<p>asdf unabhängig von einem Argument ist (laut definition argument independent), weshalb du hier auch kein typename benötigst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2465399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2465399</guid><dc:creator><![CDATA[JulianH]]></dc:creator><pubDate>Mon, 24 Aug 2015 16:15:13 GMT</pubDate></item><item><title><![CDATA[Reply to Wozu zus. &amp;quot;typename&amp;quot; in Template-Klasse-Definition? on Tue, 25 Aug 2015 18:12:07 GMT]]></title><description><![CDATA[<p>Ah ok, das leuchtet natürlich ein! Ich danke euch.</p>
<p>LG<br />
ULong</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2465579</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2465579</guid><dc:creator><![CDATA[ULong]]></dc:creator><pubDate>Tue, 25 Aug 2015 18:12:07 GMT</pubDate></item></channel></rss>