<?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[Enums und Bitfelder]]></title><description><![CDATA[<p>Hallo,</p>
<p>nehmen wir folgende Typen:</p>
<pre><code class="language-cpp">enum Type {
 a, b, c, d
};

class Wrap {
public:
 Type t : 2;
};
</code></pre>
<p>Stellt der Standard an dieser Stelle sicher, dass die Werte von Type in Wrap::t passen, indem er fordert, dass Wrap::t unsigned ist? Ich sehe das nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/142404/enums-und-bitfelder</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Sep 2026 20:09:35 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/142404.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Mar 2006 09:59:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Enums und Bitfelder on Thu, 30 Mar 2006 09:59:51 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>nehmen wir folgende Typen:</p>
<pre><code class="language-cpp">enum Type {
 a, b, c, d
};

class Wrap {
public:
 Type t : 2;
};
</code></pre>
<p>Stellt der Standard an dieser Stelle sicher, dass die Werte von Type in Wrap::t passen, indem er fordert, dass Wrap::t unsigned ist? Ich sehe das nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1027006</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1027006</guid><dc:creator><![CDATA[Ponto]]></dc:creator><pubDate>Thu, 30 Mar 2006 09:59:51 GMT</pubDate></item><item><title><![CDATA[Reply to Enums und Bitfelder on Thu, 30 Mar 2006 12:20:52 GMT]]></title><description><![CDATA[<p>Falsches Forum, der C-Standard verbietet enum-Bitfelder.</p>
<p>Im C++-Standard findet sich ein Hinweis, der folgendes besagt:</p>
<blockquote>
<p>If the value of an enumerator is stored into a bit-field of the same enumeration type and the number of bits in the bit-field is large enough to hold all the values of that enumeration type, the original enumerator value and the value of the bit-field shall compare equal. [...]</p>
</blockquote>
<p>(9.6p4)</p>
<p>Also muß man sich um Vergleiche und Zuweisungen keine tieferen Gedanken machen, es funktioniert halt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1027082</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1027082</guid><dc:creator><![CDATA[Daniel E.]]></dc:creator><pubDate>Thu, 30 Mar 2006 12:20:52 GMT</pubDate></item><item><title><![CDATA[Reply to Enums und Bitfelder on Thu, 30 Mar 2006 12:42:55 GMT]]></title><description><![CDATA[<p>Daniel E. schrieb:</p>
<blockquote>
<p>Falsches Forum, der C-Standard verbietet enum-Bitfelder.</p>
<p>Im C++-Standard findet sich ein Hinweis, der folgendes besagt:</p>
<blockquote>
<p>If the value of an enumerator is stored into a bit-field of the same enumeration type and the number of bits in the bit-field is large enough to hold all the values of that enumeration type, the original enumerator value and the value of the bit-field shall compare equal. [...]</p>
</blockquote>
<p>(9.6p4)</p>
<p>Also muß man sich um Vergleiche und Zuweisungen keine tieferen Gedanken machen, es funktioniert halt.</p>
</blockquote>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1027106</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1027106</guid><dc:creator><![CDATA[Ponto]]></dc:creator><pubDate>Thu, 30 Mar 2006 12:42:55 GMT</pubDate></item><item><title><![CDATA[Reply to Enums und Bitfelder on Thu, 30 Mar 2006 14:59:31 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=13512" rel="nofollow">c.rackwitz</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=10" rel="nofollow">ANSI C</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1027237</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1027237</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 30 Mar 2006 14:59:31 GMT</pubDate></item></channel></rss>