<?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[Operator * überladung]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich weiß ihr seid es leid immer wieder zum thema operator überladung zu lesen.<br />
allerdings helfen mir die anderen themen und google net viel weiter...</p>
<p>Ich habe Class1 in der ich eine Multiplikation zweier Typen benutzen will<br />
(Der sinn der dahinter steckt ist wurscht - es geht nur um das wie) also z.B:</p>
<pre><code class="language-cpp">vector&lt;int&gt; vec;
//myVec ist z.B ein von mir selbst
//definierter Vektor.
vec = vec * myVec;
</code></pre>
<p>nun muss ich doch den operator * überladen.<br />
ich versuche das so:</p>
<pre><code class="language-cpp">vector&lt;int&gt; Class1::operator*(vector&lt;int&gt; lhs, myVec rhs)
{
...
}

//und im header:
vector&lt;int&gt; operator*(vector&lt;int&gt; lhs, myVec rhs)
</code></pre>
<p>wo liegen meine Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/155023/operator-überladung</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 02:33:35 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/155023.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 01 Aug 2006 20:24:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Operator * überladung on Tue, 01 Aug 2006 20:24:33 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich weiß ihr seid es leid immer wieder zum thema operator überladung zu lesen.<br />
allerdings helfen mir die anderen themen und google net viel weiter...</p>
<p>Ich habe Class1 in der ich eine Multiplikation zweier Typen benutzen will<br />
(Der sinn der dahinter steckt ist wurscht - es geht nur um das wie) also z.B:</p>
<pre><code class="language-cpp">vector&lt;int&gt; vec;
//myVec ist z.B ein von mir selbst
//definierter Vektor.
vec = vec * myVec;
</code></pre>
<p>nun muss ich doch den operator * überladen.<br />
ich versuche das so:</p>
<pre><code class="language-cpp">vector&lt;int&gt; Class1::operator*(vector&lt;int&gt; lhs, myVec rhs)
{
...
}

//und im header:
vector&lt;int&gt; operator*(vector&lt;int&gt; lhs, myVec rhs)
</code></pre>
<p>wo liegen meine Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1108835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1108835</guid><dc:creator><![CDATA[neuling3]]></dc:creator><pubDate>Tue, 01 Aug 2006 20:24:33 GMT</pubDate></item><item><title><![CDATA[Reply to Operator * überladung on Tue, 01 Aug 2006 20:42:35 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">vector&lt;int&gt; lhs
</code></pre>
<p>Aus der Parameterliste rauslassen. Oder eine nicht Membermethode verwenden.</p>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1108847</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1108847</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Tue, 01 Aug 2006 20:42:35 GMT</pubDate></item><item><title><![CDATA[Reply to Operator * überladung on Tue, 01 Aug 2006 21:17:29 GMT]]></title><description><![CDATA[<p>Zu class mechanics hilft Dir vielleicht folgender kleiner Artikel von Herb Sutter:<br />
<a href="http://www.gotw.ca/gotw/004.htm" rel="nofollow">http://www.gotw.ca/gotw/004.htm</a></p>
<p>ansonsten: <a href="http://www.willemer.de/informatik/cpp/cppovrld.htm" rel="nofollow">http://www.willemer.de/informatik/cpp/cppovrld.htm</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1108860</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1108860</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Tue, 01 Aug 2006 21:17:29 GMT</pubDate></item></channel></rss>