Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70154 - in sandbox/enums/libs/enums/test: . enum_class/cons enum_class/conversion enum_class/meta
From: vicente.botet_at_[hidden]
Date: 2011-03-18 18:15:16


Author: viboes
Date: 2011-03-18 18:15:13 EDT (Fri, 18 Mar 2011)
New Revision: 70154
URL: http://svn.boost.org/trac/boost/changeset/70154

Log:
Enums: rename enum_type by native_type
Text files modified:
   sandbox/enums/libs/enums/test/EnumClass.cpp | 10 +++++-----
   sandbox/enums/libs/enums/test/EnumClass.hpp | 10 +++++-----
   sandbox/enums/libs/enums/test/Ex.hpp | 6 +++---
   sandbox/enums/libs/enums/test/enum_class/cons/default_to_0_fail.cpp | 2 +-
   sandbox/enums/libs/enums/test/enum_class/cons/default_to_0_pass.cpp | 2 +-
   sandbox/enums/libs/enums/test/enum_class/conversion/explicit_conversion_from_invalid_int_fail.cpp | 2 +-
   sandbox/enums/libs/enums/test/enum_class/meta/pred_of_first_fail.cpp | 2 +-
   sandbox/enums/libs/enums/test/enum_class/meta/succ_of_last_fail.cpp | 2 +-
   sandbox/enums/libs/enums/test/enum_class/meta/val_of_invalid_fail.cpp | 2 +-
   9 files changed, 19 insertions(+), 19 deletions(-)

Modified: sandbox/enums/libs/enums/test/EnumClass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/EnumClass.cpp (original)
+++ sandbox/enums/libs/enums/test/EnumClass.cpp 2011-03-18 18:15:13 EDT (Fri, 18 Mar 2011)
@@ -69,21 +69,21 @@
 #endif
   { // Construction of the wrapper with an invalid ints results in run-time error (undefined behavior)
 // EnumClass e(convert_to<EnumClass>((unsigned char)(6)));
- BOOST_TEST((unsigned char)(enums::enum_type<EnumClass>::type(6))==(unsigned char)(6));
-// BOOST_TEST(enum_value(e)==(unsigned char)(6));
+ BOOST_TEST((unsigned char)(enums::native_type<EnumClass>::type(6))==(unsigned char)(6));
+// BOOST_TEST(native_value(e)==(unsigned char)(6));
   }
     { // The wrapper can be used in switch through the function get only :(
     EnumClass e = EnumClass::Default;
- enums::enum_type<EnumClass>::type c=enum_value(e);
+ enums::native_type<EnumClass>::type c=native_value(e);
           std::cout << int(c) << std::endl;
- switch (enum_value(e)) { // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ switch (native_value(e)) { // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       case EnumClass::Enum1:
       case EnumClass::Enum2:
       case EnumClass::Default:
           std::cout << e << std::endl;
         break;
       default:
- //std::cout << e << ":"<< enum_value(e) << std::endl;
+ //std::cout << e << ":"<< native_value(e) << std::endl;
         ;
     }
   }

Modified: sandbox/enums/libs/enums/test/EnumClass.hpp
==============================================================================
--- sandbox/enums/libs/enums/test/EnumClass.hpp (original)
+++ sandbox/enums/libs/enums/test/EnumClass.hpp 2011-03-18 18:15:13 EDT (Fri, 18 Mar 2011)
@@ -78,7 +78,7 @@
 //!explicit conversion to c-string.
 inline const char* c_str(EnumClass e)
 {
- switch (boost::enums::enum_value(e))
+ switch (boost::enums::native_value(e))
     {
     case EnumClass::Default : return("EnumClass::Default");
     case EnumClass::Enum1: return("EnumClass::Enum1");
@@ -116,17 +116,17 @@
     template <>
     struct val<EnumClass, 0>
     {
- BOOST_STATIC_CONSTEXPR boost::enums::enum_type<EnumClass>::type value = EnumClass::Default;
+ BOOST_STATIC_CONSTEXPR boost::enums::native_type<EnumClass>::type value = EnumClass::Default;
     };
     template <>
     struct val<EnumClass, 1>
     {
- BOOST_STATIC_CONSTEXPR boost::enums::enum_type<EnumClass>::type value = EnumClass::Enum1;
+ BOOST_STATIC_CONSTEXPR boost::enums::native_type<EnumClass>::type value = EnumClass::Enum1;
     };
     template <>
     struct val<EnumClass, 2>
     {
- BOOST_STATIC_CONSTEXPR boost::enums::enum_type<EnumClass>::type value = EnumClass::Enum2;
+ BOOST_STATIC_CONSTEXPR boost::enums::native_type<EnumClass>::type value = EnumClass::Enum2;
     };
     template <>
     struct enum_traits<EnumClass>
@@ -142,7 +142,7 @@
 //! OSTRREAM overloading
 template <typename OSTREAM>
 inline OSTREAM& operator <<(OSTREAM& os, EnumClass v) {
- os << int(boost::enums::enum_value(v));
+ os << int(boost::enums::native_value(v));
   return os;
 }
 

Modified: sandbox/enums/libs/enums/test/Ex.hpp
==============================================================================
--- sandbox/enums/libs/enums/test/Ex.hpp (original)
+++ sandbox/enums/libs/enums/test/Ex.hpp 2011-03-18 18:15:13 EDT (Fri, 18 Mar 2011)
@@ -68,17 +68,17 @@
     template <>
     struct val<EC3, 0>
     {
- BOOST_STATIC_CONSTEXPR boost::enums::enum_type<EC3>::type value = EC3::Enum0;
+ BOOST_STATIC_CONSTEXPR boost::enums::native_type<EC3>::type value = EC3::Enum0;
     };
     template <>
     struct val<EC3, 1>
     {
- BOOST_STATIC_CONSTEXPR boost::enums::enum_type<EC3>::type value = EC3::Enum1;
+ BOOST_STATIC_CONSTEXPR boost::enums::native_type<EC3>::type value = EC3::Enum1;
     };
     template <>
     struct val<EC3, 2>
     {
- BOOST_STATIC_CONSTEXPR boost::enums::enum_type<EC3>::type value = EC3::Enum2;
+ BOOST_STATIC_CONSTEXPR boost::enums::native_type<EC3>::type value = EC3::Enum2;
     };
     template <>
     struct enum_traits<EC3> : linear_enum_traiter<EC3>

Modified: sandbox/enums/libs/enums/test/enum_class/cons/default_to_0_fail.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/cons/default_to_0_fail.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/cons/default_to_0_fail.cpp 2011-03-18 18:15:13 EDT (Fri, 18 Mar 2011)
@@ -18,7 +18,7 @@
 
   { // defaults to the enum default
     EnumClass e = EnumClass() ;
- BOOST_TEST(enum_value(e)==0);
+ BOOST_TEST(native_value(e)==0);
   }
   return boost::report_errors();
 }

Modified: sandbox/enums/libs/enums/test/enum_class/cons/default_to_0_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/cons/default_to_0_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/cons/default_to_0_pass.cpp 2011-03-18 18:15:13 EDT (Fri, 18 Mar 2011)
@@ -18,7 +18,7 @@
 
   { // defaults to the enum default
     EC3 e = EC3() ;
- BOOST_TEST(int(enum_value(e))==0);
+ BOOST_TEST(int(native_value(e))==0);
   }
   return boost::report_errors();
 }

Modified: sandbox/enums/libs/enums/test/enum_class/conversion/explicit_conversion_from_invalid_int_fail.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/conversion/explicit_conversion_from_invalid_int_fail.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/conversion/explicit_conversion_from_invalid_int_fail.cpp 2011-03-18 18:15:13 EDT (Fri, 18 Mar 2011)
@@ -18,7 +18,7 @@
 
   { // Explicit conversion from invalid int results in run-time error (undefined behavior)
     EnumClass e(boost::convert_to<EnumClass>((unsigned char)(6)));
- BOOST_TEST((unsigned char)(enum_value(e))==(unsigned char)(6));
+ BOOST_TEST((unsigned char)(native_value(e))==(unsigned char)(6));
   }
 
   return boost::report_errors();

Modified: sandbox/enums/libs/enums/test/enum_class/meta/pred_of_first_fail.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/pred_of_first_fail.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/pred_of_first_fail.cpp 2011-03-18 18:15:13 EDT (Fri, 18 Mar 2011)
@@ -18,7 +18,7 @@
   using namespace boost::enums;
 
   {
- enum_type<EnumClass>::type e = meta::pred<EnumClass, EnumClass::Default>::value;
+ native_type<EnumClass>::type e = meta::pred<EnumClass, EnumClass::Default>::value;
   }
 
 }

Modified: sandbox/enums/libs/enums/test/enum_class/meta/succ_of_last_fail.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/succ_of_last_fail.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/succ_of_last_fail.cpp 2011-03-18 18:15:13 EDT (Fri, 18 Mar 2011)
@@ -18,7 +18,7 @@
   using namespace boost::enums;
 
   {
- enum_type<EnumClass>::type e = meta::succ<EnumClass, EnumClass::Enum2>::value ;
+ native_type<EnumClass>::type e = meta::succ<EnumClass, EnumClass::Enum2>::value ;
   }
 
 }

Modified: sandbox/enums/libs/enums/test/enum_class/meta/val_of_invalid_fail.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/meta/val_of_invalid_fail.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/meta/val_of_invalid_fail.cpp 2011-03-18 18:15:13 EDT (Fri, 18 Mar 2011)
@@ -17,7 +17,7 @@
   using namespace boost::enums;
 
   { // has the same size as the underlying type
- enum_type<EnumClass>::type e= meta::val<EnumClass,3>::value;
+ native_type<EnumClass>::type e= meta::val<EnumClass,3>::value;
     (void)(e);
   }
 


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