<?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[dependent name is not a type prefix with &#x27;typename&#x27; to indicate a type???]]></title><description><![CDATA[<p>Hallo,<br />
ich hab unten mal meinen code etwas abstrahiert um das problem auf den punkt zu bringen, ich hab leider keine ahnung wo das problem liegt. vllt kann mir ja jemand helfen, wäre sehr dankbar.</p>
<pre><code class="language-cpp">template&lt;class t&gt;
class A
{
	t a;
	public:
		A(t const &amp;src = t());
		class B
		{
			private:
				t b;
			public:
				B(t const &amp;src = t());
				B &amp;operator = (B const &amp;src);
		};
};

template&lt;class t&gt;
A&lt;t&gt;::A(t const &amp;src)
{
	a = src;
};

template&lt;class t&gt;
A&lt;t&gt;::B::B(t const &amp;src)
{
	b = src;
};

template&lt;class t&gt;
//hier liegt der fehler beim rückgabetyp,
//ich hab mal nur B, statt A&lt;t&gt;::B ausprobiert geht aber auch nicht
A&lt;t&gt;::B &amp;A&lt;t&gt;::B::operator = (B const &amp;src)
{
	b = src.b;
	return *this;
};
</code></pre>
<p>also meldung vom compiler (MSVC++2008EE) bekomme ich dann folgendes:</p>
<pre><code>warning C4346: 'A&lt;t&gt;::B' : dependent name is not a type prefix with 'typename' to indicate a type
</code></pre>
<p>vielen dank schon mal im voraus.<br />
grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/218540/dependent-name-is-not-a-type-prefix-with-typename-to-indicate-a-type</link><generator>RSS for Node</generator><lastBuildDate>Fri, 09 Oct 2026 03:03:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/218540.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 22 Jul 2008 08:02:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to dependent name is not a type prefix with &#x27;typename&#x27; to indicate a type??? on Tue, 22 Jul 2008 08:02:16 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich hab unten mal meinen code etwas abstrahiert um das problem auf den punkt zu bringen, ich hab leider keine ahnung wo das problem liegt. vllt kann mir ja jemand helfen, wäre sehr dankbar.</p>
<pre><code class="language-cpp">template&lt;class t&gt;
class A
{
	t a;
	public:
		A(t const &amp;src = t());
		class B
		{
			private:
				t b;
			public:
				B(t const &amp;src = t());
				B &amp;operator = (B const &amp;src);
		};
};

template&lt;class t&gt;
A&lt;t&gt;::A(t const &amp;src)
{
	a = src;
};

template&lt;class t&gt;
A&lt;t&gt;::B::B(t const &amp;src)
{
	b = src;
};

template&lt;class t&gt;
//hier liegt der fehler beim rückgabetyp,
//ich hab mal nur B, statt A&lt;t&gt;::B ausprobiert geht aber auch nicht
A&lt;t&gt;::B &amp;A&lt;t&gt;::B::operator = (B const &amp;src)
{
	b = src.b;
	return *this;
};
</code></pre>
<p>also meldung vom compiler (MSVC++2008EE) bekomme ich dann folgendes:</p>
<pre><code>warning C4346: 'A&lt;t&gt;::B' : dependent name is not a type prefix with 'typename' to indicate a type
</code></pre>
<p>vielen dank schon mal im voraus.<br />
grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1551415</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1551415</guid><dc:creator><![CDATA[StarCraftFeuerteufel]]></dc:creator><pubDate>Tue, 22 Jul 2008 08:02:16 GMT</pubDate></item><item><title><![CDATA[Reply to dependent name is not a type prefix with &#x27;typename&#x27; to indicate a type??? on Tue, 22 Jul 2008 08:11:50 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">template&lt;class t&gt;
typename A&lt;t&gt;::B &amp;A&lt;t&gt;::B::operator = (B const &amp;src)
{
    b = src.b;
    return *this;
};
</code></pre>
<p>Du musst dem compiler sagen, dass A::B ein Typ ist. Es könnte ja auch ein statischer Member sein oder sowas. Andere Compiler geben hier denke ich sogar einen Fehler aus (was glaube ich auch so im standard steht)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1551430</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1551430</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Tue, 22 Jul 2008 08:11:50 GMT</pubDate></item><item><title><![CDATA[Reply to dependent name is not a type prefix with &#x27;typename&#x27; to indicate a type??? on Tue, 22 Jul 2008 08:14:50 GMT]]></title><description><![CDATA[<p>ok danke, hat funktioniert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1551438</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1551438</guid><dc:creator><![CDATA[StarCraftFeuerteufel]]></dc:creator><pubDate>Tue, 22 Jul 2008 08:14:50 GMT</pubDate></item></channel></rss>