<?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[eigenartiger gebrauch von enum]]></title><description><![CDATA[<p>hallo leute</p>
<p>in VS2012 - datei: xiosbase steht folgendes:</p>
<pre><code>enum _Iostate
		{	// constants for stream states
		_Statmask = 0x17};

	static const _Iostate goodbit = (_Iostate)0x0;
	static const _Iostate eofbit = (_Iostate)0x1;
	static const _Iostate failbit = (_Iostate)0x2;
	static const _Iostate badbit = (_Iostate)0x4;
	static const _Iostate _Hardfail = (_Iostate)0x10;
</code></pre>
<p>was hat das fuer einen sinn goodbit usw. so zu definieren?</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/319026/eigenartiger-gebrauch-von-enum</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Jul 2026 06:31:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/319026.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 04 Aug 2013 13:53:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to eigenartiger gebrauch von enum on Sun, 04 Aug 2013 13:53:53 GMT]]></title><description><![CDATA[<p>hallo leute</p>
<p>in VS2012 - datei: xiosbase steht folgendes:</p>
<pre><code>enum _Iostate
		{	// constants for stream states
		_Statmask = 0x17};

	static const _Iostate goodbit = (_Iostate)0x0;
	static const _Iostate eofbit = (_Iostate)0x1;
	static const _Iostate failbit = (_Iostate)0x2;
	static const _Iostate badbit = (_Iostate)0x4;
	static const _Iostate _Hardfail = (_Iostate)0x10;
</code></pre>
<p>was hat das fuer einen sinn goodbit usw. so zu definieren?</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343358</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343358</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Sun, 04 Aug 2013 13:53:53 GMT</pubDate></item><item><title><![CDATA[Reply to eigenartiger gebrauch von enum on Sun, 04 Aug 2013 13:58:14 GMT]]></title><description><![CDATA[<p>Man kann das enum als Bitmaske benutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343359</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Sun, 04 Aug 2013 13:58:14 GMT</pubDate></item><item><title><![CDATA[Reply to eigenartiger gebrauch von enum on Sun, 04 Aug 2013 16:13:11 GMT]]></title><description><![CDATA[<p>knivil schrieb:</p>
<blockquote>
<p>Man kann das enum als Bitmaske benutzen.</p>
</blockquote>
<p>Könnte man auch sonst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343376</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343376</guid><dc:creator><![CDATA[karneval]]></dc:creator><pubDate>Sun, 04 Aug 2013 16:13:11 GMT</pubDate></item><item><title><![CDATA[Reply to eigenartiger gebrauch von enum on Sun, 04 Aug 2013 16:22:57 GMT]]></title><description><![CDATA[<p><a href="http://en.cppreference.com/w/cpp/concept/BitmaskType" rel="nofollow">http://en.cppreference.com/w/cpp/concept/BitmaskType</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343379</guid><dc:creator><![CDATA[nzhartgesd]]></dc:creator><pubDate>Sun, 04 Aug 2013 16:22:57 GMT</pubDate></item><item><title><![CDATA[Reply to eigenartiger gebrauch von enum on Sun, 04 Aug 2013 20:37:10 GMT]]></title><description><![CDATA[<p>karneval schrieb:</p>
<blockquote>
<p>knivil schrieb:</p>
<blockquote>
<p>Man kann das enum als Bitmaske benutzen.</p>
</blockquote>
<p>Könnte man auch sonst.</p>
</blockquote>
<p>Nee, wenn einzelne Bits getestet werden sollen, dann ist ein aequivalenter Zahlwert von 3 eher bloed.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343426</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343426</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Sun, 04 Aug 2013 20:37:10 GMT</pubDate></item><item><title><![CDATA[Reply to eigenartiger gebrauch von enum on Sun, 04 Aug 2013 21:14:57 GMT]]></title><description><![CDATA[<p>Ich meine, warum nicht so?</p>
<pre><code class="language-cpp">enum _Iostate
{ // constants for stream states
  goodbit = 0x0,
  eofbit  = 0x1,
  failbit = 0x2,
  badbit  = 0x4,
  _Hardfail = 0x10,
  _Statmask = 0x17
};
</code></pre>
<p>Nach meinem Verständnis kommt das aufs Gleiche raus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343434</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343434</guid><dc:creator><![CDATA[karneval]]></dc:creator><pubDate>Sun, 04 Aug 2013 21:14:57 GMT</pubDate></item><item><title><![CDATA[Reply to eigenartiger gebrauch von enum on Mon, 05 Aug 2013 07:43:30 GMT]]></title><description><![CDATA[<p>Die Definition</p>
<pre><code>enum _Iostate { goodbit = 0x0 };
</code></pre>
<p>ist semantisch fast äquivalent zu</p>
<pre><code>enum _Iostate {};
    static constexpr _Iostate goodbit = (_Iostate)0x0;
</code></pre>
<blockquote>
<p>The identifiers in anenumerator-list are declared as constants, and can appear wherever constants are required.<br />
[...]<br />
Following the closing brace of an enum-specifier, each enumerator has the type of its enumeration.<br />
[...]<br />
Each enum-name and each unscoped enumerator is declared in the scope that immediately contains the enum-specifier.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2343483</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343483</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Mon, 05 Aug 2013 07:43:30 GMT</pubDate></item><item><title><![CDATA[Reply to eigenartiger gebrauch von enum on Mon, 05 Aug 2013 08:43:40 GMT]]></title><description><![CDATA[<p>karneval schrieb:</p>
<blockquote>
<p>Ich meine, warum nicht so?</p>
<pre><code class="language-cpp">enum _Iostate
{ // constants for stream states
  goodbit = 0x0,
  eofbit  = 0x1,
  failbit = 0x2,
  badbit  = 0x4,
  _Hardfail = 0x10,
  _Statmask = 0x17
};
</code></pre>
<p>Nach meinem Verständnis kommt das aufs Gleiche raus.</p>
</blockquote>
<p>Kommt auf's gleiche raus ist das eine.<br />
Im Standard steht aber:</p>
<pre><code class="language-cpp">namespace std {
  class ios_base {
    // ...
    // 27.5.3.1.3 iostate
    typedef T2 iostate;
    static constexpr iostate badbit = unspecified ;
    static constexpr iostate eofbit = unspecified ;
    static constexpr iostate failbit = unspecified ;
    static constexpr iostate goodbit = see below;
  };
}
</code></pre>
<p>Da ist nix dran zu rütteln.</p>
<p>gcc machts übrigens anders als msvc:</p>
<pre><code class="language-cpp">namespace std{
 enum _Ios_Iostate
    { 
      _S_goodbit 		= 0,
      _S_badbit 		= 1L &lt;&lt; 0,
      _S_eofbit 		= 1L &lt;&lt; 1,
      _S_failbit		= 1L &lt;&lt; 2,
      _S_ios_iostate_end = 1L &lt;&lt; 16 
    };

    class ios_base{
        //...
        typedef _Ios_Iostate iostate;

        static const iostate badbit =	_S_badbit;
        static const iostate eofbit =	_S_eofbit;
        static const iostate failbit =	_S_failbit;
        static const iostate goodbit =	_S_goodbit;
    };
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2343494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343494</guid><dc:creator><![CDATA[Furble Wurble]]></dc:creator><pubDate>Mon, 05 Aug 2013 08:43:40 GMT</pubDate></item><item><title><![CDATA[Reply to eigenartiger gebrauch von enum on Mon, 05 Aug 2013 08:49:32 GMT]]></title><description><![CDATA[<blockquote>
<p>Ich meine, warum nicht so?</p>
</blockquote>
<p>Dann sag, was du meinst, anstatt Raetselraten auszuloesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343496</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343496</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Mon, 05 Aug 2013 08:49:32 GMT</pubDate></item></channel></rss>