<?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[Typedefs inkompatibel machen]]></title><description><![CDATA[<p>Hallo</p>
<p>Im Grunde suche ich eine Möglichkeit, mit der ich einem Typen mit vielen Operatoren (das ist in meinem konkreten Fall eine Klasse, kann aber durchaus auch als z.b. <code>int</code> angesehen werden) <code>typedef</code> en kann aber so dass die neuen Typen nicht impizit in den alten geschweige denn in sich gegenseitig konvertierbar sind.<br />
Formal etwa so:</p>
<pre><code>struct ManyOperators
{
	...
};

typedef ManyOperators A;
typedef ManyOperators B;
typedef ManyOperators C;

int main()
{
	ManyOperators m;
	A a;
	B b;
	C c;

	m = m; // Ok
	a = a; // Ok

	m = a; // Fehler
	c = b; // Fehler
}
</code></pre>
<p>Danke im Voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/325755/typedefs-inkompatibel-machen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 19:39:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/325755.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 May 2014 17:12:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Typedefs inkompatibel machen on Fri, 16 May 2014 17:12:07 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Im Grunde suche ich eine Möglichkeit, mit der ich einem Typen mit vielen Operatoren (das ist in meinem konkreten Fall eine Klasse, kann aber durchaus auch als z.b. <code>int</code> angesehen werden) <code>typedef</code> en kann aber so dass die neuen Typen nicht impizit in den alten geschweige denn in sich gegenseitig konvertierbar sind.<br />
Formal etwa so:</p>
<pre><code>struct ManyOperators
{
	...
};

typedef ManyOperators A;
typedef ManyOperators B;
typedef ManyOperators C;

int main()
{
	ManyOperators m;
	A a;
	B b;
	C c;

	m = m; // Ok
	a = a; // Ok

	m = a; // Fehler
	c = b; // Fehler
}
</code></pre>
<p>Danke im Voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2399507</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2399507</guid><dc:creator><![CDATA[p-addicted]]></dc:creator><pubDate>Fri, 16 May 2014 17:12:07 GMT</pubDate></item><item><title><![CDATA[Reply to Typedefs inkompatibel machen on Fri, 16 May 2014 17:21:37 GMT]]></title><description><![CDATA[<p>Opaque Typedefs gibts nicht als Sprachfeature. Du könntest dir <code>BOOST_STRONG_TYPEDEF</code> anschauen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2399508</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2399508</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Fri, 16 May 2014 17:21:37 GMT</pubDate></item><item><title><![CDATA[Reply to Typedefs inkompatibel machen on Fri, 16 May 2014 17:31:05 GMT]]></title><description><![CDATA[<blockquote>
<p>Opaque Typedefs gibts nicht als Sprachfeature</p>
</blockquote>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3515.pdf" rel="nofollow">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3515.pdf</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2399511</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2399511</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Fri, 16 May 2014 17:31:05 GMT</pubDate></item><item><title><![CDATA[Reply to Typedefs inkompatibel machen on Fri, 16 May 2014 17:31:46 GMT]]></title><description><![CDATA[<p>BOOST_STRONG_TYPEDEF bietet allerdings keinen intutiven Methodenzugriff.<br />
Du kannst aber das Prinzip übernehmen und geeignete Forwardfunktionen schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2399513</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2399513</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Fri, 16 May 2014 17:31:46 GMT</pubDate></item><item><title><![CDATA[Reply to Typedefs inkompatibel machen on Sat, 17 May 2014 15:50:03 GMT]]></title><description><![CDATA[<p>Enumerationen anyone?<br />
Bei Klassen funzt det nicht, aber bei den beschrieben Integern schon.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2399630</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2399630</guid><dc:creator><![CDATA[Pottsau Wildwest]]></dc:creator><pubDate>Sat, 17 May 2014 15:50:03 GMT</pubDate></item></channel></rss>