Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70025 - sandbox/enums/libs/enums/example
From: vicente.botet_at_[hidden]
Date: 2011-03-16 16:57:31


Author: viboes
Date: 2011-03-16 16:57:30 EDT (Wed, 16 Mar 2011)
New Revision: 70025
URL: http://svn.boost.org/trac/boost/changeset/70025

Log:
Enums: Fix issue with oprators for enum type
Text files modified:
   sandbox/enums/libs/enums/example/unsigned.cpp | 7 ++++++-
   1 files changed, 6 insertions(+), 1 deletions(-)

Modified: sandbox/enums/libs/enums/example/unsigned.cpp
==============================================================================
--- sandbox/enums/libs/enums/example/unsigned.cpp (original)
+++ sandbox/enums/libs/enums/example/unsigned.cpp 2011-03-16 16:57:30 EDT (Wed, 16 Mar 2011)
@@ -15,7 +15,7 @@
 
 BOOST_ENUM_TYPE_START(E, unsigned long)
 { E1 = 1, E2 = 2, Ebig = 0xFFFFFFF0U }
-BOOST_ENUM_TYPE_END(E, unsigned long)
+BOOST_ENUM_TYPE_CONS_END(E, unsigned long)
 BOOST_ENUMS_SPECIALIZATIONS(E, unsigned long)
 
 
@@ -24,6 +24,11 @@
   std::cout << "Ebig = " << E::Ebig << std::endl;
   std::cout << "E1 ? -1 =\t" << ( E::E1 < -1 ? "less" : E::E1 > -1 ? "greater" : "equal" ) << std::endl;
   std::cout << "Ebig ? -1 =\t" << ( E::Ebig < -1 ? "less" : E::Ebig > -1 ? "greater" : "equal" ) << std::endl;
+
+ E e1(E::E1);
+ E ebig(E::Ebig);
+ std::cout << "e1 ? -1 =\t" << ( e1 < -1 ? "less" : e1 > -1 ? "greater" : "equal" ) << std::endl;
+ std::cout << "ebig ? -1 =\t" << ( ebig < -1 ? "less" : ebig > -1 ? "greater" : "equal" ) << std::endl;
   return 0;
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk