<?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[Überladen von operator&amp;lt; innerhalb einer Klasse]]></title><description><![CDATA[<p>Hallo Forum,</p>
<p>ich habe ein seltsames Problem mit dem Überladen von Operatoren.<br />
Das Problem ist in den folgenden Codezeilen zusammengefasst, einmal<br />
kann ich den Kleiner-Operator aufrufen, einmal gibt's einen Compiler-Fehler.<br />
Als Compiler verwende ich Visual Studio .NET (2003).</p>
<pre><code>class CAussen
{
public:

	class Test
	{
	public:
		Test( int i ) : t_(i) { ; } ;
		bool operator&lt;= ( const Test &amp;other)
		{
			return (this-&gt;t_ &lt; other.t_);
		};

	private:
		int t_;
	};

	void vTest(void)
	{
		Test t1(3), t2(4);
		bool b = ( t1 &lt; t2 ); // MS-VC7.1 (VS2003) -&gt; &quot;error C2676: binary '&lt;' : 'CAussen::Test' does not define this operator or a conversion to a type acceptable to the predefined operator&quot;

	};
};

int main(int, char **)
{
	CAussen::Test q1(3), q2(43);
	const bool b = (q1 &lt;= q2); // funktioniert
	std::cout &lt;&lt; b &lt;&lt; std::endl;

	return 0;
}
</code></pre>
<p>Hat jemand hierzu eine Idee??<br />
Danke im Voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/129855/überladen-von-operator-lt-innerhalb-einer-klasse</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 10:18:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/129855.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 17 Dec 2005 11:09:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Überladen von operator&amp;lt; innerhalb einer Klasse on Sat, 17 Dec 2005 11:09:45 GMT]]></title><description><![CDATA[<p>Hallo Forum,</p>
<p>ich habe ein seltsames Problem mit dem Überladen von Operatoren.<br />
Das Problem ist in den folgenden Codezeilen zusammengefasst, einmal<br />
kann ich den Kleiner-Operator aufrufen, einmal gibt's einen Compiler-Fehler.<br />
Als Compiler verwende ich Visual Studio .NET (2003).</p>
<pre><code>class CAussen
{
public:

	class Test
	{
	public:
		Test( int i ) : t_(i) { ; } ;
		bool operator&lt;= ( const Test &amp;other)
		{
			return (this-&gt;t_ &lt; other.t_);
		};

	private:
		int t_;
	};

	void vTest(void)
	{
		Test t1(3), t2(4);
		bool b = ( t1 &lt; t2 ); // MS-VC7.1 (VS2003) -&gt; &quot;error C2676: binary '&lt;' : 'CAussen::Test' does not define this operator or a conversion to a type acceptable to the predefined operator&quot;

	};
};

int main(int, char **)
{
	CAussen::Test q1(3), q2(43);
	const bool b = (q1 &lt;= q2); // funktioniert
	std::cout &lt;&lt; b &lt;&lt; std::endl;

	return 0;
}
</code></pre>
<p>Hat jemand hierzu eine Idee??<br />
Danke im Voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/944139</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/944139</guid><dc:creator><![CDATA[atlastraeger]]></dc:creator><pubDate>Sat, 17 Dec 2005 11:09:45 GMT</pubDate></item><item><title><![CDATA[Reply to Überladen von operator&amp;lt; innerhalb einer Klasse on Sat, 17 Dec 2005 11:37:47 GMT]]></title><description><![CDATA[<p>Ja:</p>
<p>Du hast einen operator&lt;= definiert und versuchst bei dem Fehler den operator&lt; zu verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/944174</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/944174</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Sat, 17 Dec 2005 11:37:47 GMT</pubDate></item></channel></rss>