<?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[friend funtion in template klasse]]></title><description><![CDATA[<p>in der hpp:</p>
<pre><code class="language-cpp">template &lt; class typ &gt; class vektor{
private:
	typ x,y,z;
public:
	vektor(typ a, typ b, typ c);
	friend ostream &amp;operator&lt;&lt;(ostream &amp;os, vektor(typ) &amp;name);
	friend istream &amp;operator&gt;&gt;(istream &amp;is, vektor(typ) &amp;name);
};
</code></pre>
<p>bekomme leider ne fehlermeldung bei den überladenem &gt;&gt;, &lt;&lt;!<br />
hab jetzt in einem buch gelesen das es an dem friend liegt.<br />
wir bekomm ich das denn jetzt grade gebogen?</p>
<p>in der cpp sind die funktionen so deklariert:</p>
<pre><code class="language-cpp">template &lt; class typ &gt; ostream &amp;operator &lt;&lt;(ostream &amp;os, const vektor &amp;name){
	...
return os;
}

//Eingabe Vektor
template &lt; class typ &gt; istream &amp;operator &gt;&gt;(istream &amp;is, vektor &amp;name){
	...
return is;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/242599/friend-funtion-in-template-klasse</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 23:30:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/242599.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Jun 2009 17:17:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to friend funtion in template klasse on Fri, 05 Jun 2009 17:17:16 GMT]]></title><description><![CDATA[<p>in der hpp:</p>
<pre><code class="language-cpp">template &lt; class typ &gt; class vektor{
private:
	typ x,y,z;
public:
	vektor(typ a, typ b, typ c);
	friend ostream &amp;operator&lt;&lt;(ostream &amp;os, vektor(typ) &amp;name);
	friend istream &amp;operator&gt;&gt;(istream &amp;is, vektor(typ) &amp;name);
};
</code></pre>
<p>bekomme leider ne fehlermeldung bei den überladenem &gt;&gt;, &lt;&lt;!<br />
hab jetzt in einem buch gelesen das es an dem friend liegt.<br />
wir bekomm ich das denn jetzt grade gebogen?</p>
<p>in der cpp sind die funktionen so deklariert:</p>
<pre><code class="language-cpp">template &lt; class typ &gt; ostream &amp;operator &lt;&lt;(ostream &amp;os, const vektor &amp;name){
	...
return os;
}

//Eingabe Vektor
template &lt; class typ &gt; istream &amp;operator &gt;&gt;(istream &amp;is, vektor &amp;name){
	...
return is;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1721898</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1721898</guid><dc:creator><![CDATA[HoCiEp3]]></dc:creator><pubDate>Fri, 05 Jun 2009 17:17:16 GMT</pubDate></item><item><title><![CDATA[Reply to friend funtion in template klasse on Fri, 05 Jun 2009 17:18:48 GMT]]></title><description><![CDATA[<p>template &lt; class typ &gt; ostream &amp;operator &lt;&lt;(ostream &amp;os, const typename vektor&lt;typ&gt; &amp;name){</p>
<p>nächstes mal die fehlermeldung mal lesenund evtl so gar posten!? ^^</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1721899</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1721899</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Fri, 05 Jun 2009 17:18:48 GMT</pubDate></item><item><title><![CDATA[Reply to friend funtion in template klasse on Fri, 05 Jun 2009 17:30:58 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">template &lt; class typ &gt; class vektor{ //line 13
private:
	typ x,y,z;
public:
	vektor(typ a, typ b, typ c);
	~vektor();
	...
	template &lt; class typ &gt; &amp;operator &lt;&lt;(ostream &amp;os, const vektor&lt;typ&gt; &amp;name); //line 25
	template &lt; class typ &gt; &amp;operator &gt;&gt;(istream &amp;is, vektor&lt;typ&gt; &amp;name); //line 26
};
</code></pre>
<p>..\src\vector.hpp:25: error: declaration of 'class typ'<br />
..\src\vector.hpp:13: error: shadows template parm 'class typ'<br />
..\src\vector.hpp:25: error: expected constructor, destructor, or type conversion before ';' token<br />
..\src\vector.hpp:26: error: declaration of 'class typ'<br />
..\src\vector.hpp:13: error: shadows template parm 'class typ'<br />
..\src\vector.hpp:26: error: expected constructor, destructor, or type conversion before ';' token</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1721908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1721908</guid><dc:creator><![CDATA[HoCiEp3]]></dc:creator><pubDate>Fri, 05 Jun 2009 17:30:58 GMT</pubDate></item><item><title><![CDATA[Reply to friend funtion in template klasse on Fri, 05 Jun 2009 18:06:53 GMT]]></title><description><![CDATA[<p>s.o.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1721938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1721938</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Fri, 05 Jun 2009 18:06:53 GMT</pubDate></item></channel></rss>