<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Assigning to enum variables' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Assigning to enum variables' posted on the 'C++ Builder' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Tue, 18 Jun 2013 16:39:26 -0700</pubDate>
    <lastBuildDate>Tue, 18 Jun 2013 16:39:26 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Assigning to enum variables</title>
      <link>http://www.programmersheaven.com/mb/bcbuilder/430821/430821/assigning-to-enum-variables/</link>
      <description>I have recently upgraded from Builder 6 to XE2, and have been stumped by the following:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Purple;"&gt; enum eNumber { one, two, three };&lt;br /&gt;
 ...&lt;br /&gt;
 eNumber num = one;&lt;br /&gt;
 ...&lt;br /&gt;
 num |= three;  // E2277&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
E2277 says 'Lvalue required'. Well the enum variable num is a valid Lvalue. It is OK to assign to it with a simple assigment operator, e.g: num = 2;&lt;br /&gt;
But one cannot use the 'combined' operators like |= or &amp;amp;=.&lt;br /&gt;
I even ticked the project option C++ Compiler --&amp;gt; Integer-typed enums, so that it would be treated line an int, but still got the same error.&lt;br /&gt;
I don't know if XE2 is fully C11 conformant, but I can't see anything in C11 that forbids using this syntax.&lt;br /&gt;
Any ideas much appreciated.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/bcbuilder/430821/430821/assigning-to-enum-variables/</guid>
      <pubDate>Fri, 04 Jan 2013 22:43:51 -0700</pubDate>
      <category>C++ Builder</category>
    </item>
  </channel>
</rss>