Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72260 - in sandbox/enums/libs/enums/test: . enum_class
From: vicente.botet_at_[hidden]
Date: 2011-05-29 04:29:10


Author: viboes
Date: 2011-05-29 04:29:08 EDT (Sun, 29 May 2011)
New Revision: 72260
URL: http://svn.boost.org/trac/boost/changeset/72260

Log:
Enums: moved dummy to conversion namespace
Text files modified:
   sandbox/enums/libs/enums/test/EnumClass.hpp | 16 ++++++++--------
   sandbox/enums/libs/enums/test/EnumType.hpp | 4 ++--
   sandbox/enums/libs/enums/test/enum_class/enum_inside_union_cons.pass.cpp | 10 +++++-----
   3 files changed, 15 insertions(+), 15 deletions(-)

Modified: sandbox/enums/libs/enums/test/EnumClass.hpp
==============================================================================
--- sandbox/enums/libs/enums/test/EnumClass.hpp (original)
+++ sandbox/enums/libs/enums/test/EnumClass.hpp 2011-05-29 04:29:08 EDT (Sun, 29 May 2011)
@@ -60,7 +60,7 @@
 
 //! conversion from c-string.
 inline EnumClass convert_to(const char* str
- , boost::dummy::type_tag<EnumClass> const&
+ , boost::conversion::dummy::type_tag<EnumClass> const&
 )
 {
     if (strcmp(str, "Default") ==0) { return boost::convert_to<EnumClass>(EnumClass::Default); }
@@ -71,7 +71,7 @@
 
 //! conversion from std::string.
 inline EnumClass convert_to(const std::string& str
- , boost::dummy::type_tag<EnumClass> const&
+ , boost::conversion::dummy::type_tag<EnumClass> const&
 )
 {
     return boost::convert_to<EnumClass>(str.c_str());
@@ -165,14 +165,14 @@
 class EnumClass {
 public:
   enum type { Default = 3 , Enum1 , Enum2 };
- inline friend EnumClass convert_to( const char* str, boost::dummy::type_tag<EnumClass> const& )
+ inline friend EnumClass convert_to( const char* str, boost::conversion::dummy::type_tag<EnumClass> const& )
   {
     if (strcmp( str, "Default" ) == 0) { return boost::convert_to<EnumClass>( EnumClass::Default ); }
     if (strcmp( str, "Enum1" ) == 0) { return boost::convert_to<EnumClass>( EnumClass::Enum1 ); }
     if (strcmp( str, "Enum2" ) == 0) { return boost::convert_to<EnumClass>( EnumClass::Enum2 ); }
     throw "invalid string for " "EnumClass";
   }
- inline friend EnumClass convert_to( const std::string& str, boost::dummy::type_tag<EnumClass> const& )
+ inline friend EnumClass convert_to( const std::string& str, boost::conversion::dummy::type_tag<EnumClass> const& )
   {
     return boost::convert_to<EnumClass>( str.c_str() );
   }
@@ -200,10 +200,10 @@
   static EnumClass convert_to(type v) { EnumClass res; res.val_=static_cast<underlying_type>(v); return res; }
   type native_value() const { return type(val_); }
   underlying_type underlying_value() const { return val_; }
- inline friend EnumClass convert_to(int v , boost::dummy::type_tag<EnumClass> const& ) { return EnumClass::convert_to(v); }
- inline friend EnumClass convert_to(boost::enums::native_type<EnumClass>::type v , boost::dummy::type_tag<EnumClass> const& ) { return EnumClass::convert_to(v); }
- inline friend int convert_to(EnumClass v , boost::dummy::type_tag<int> const& ) { return boost::enums::underlying_value(v); }
- inline friend boost::enums::native_type<EnumClass>::type convert_to(EnumClass v , boost::dummy::type_tag<boost::enums::native_type<EnumClass>::type> const& ) {
+ inline friend EnumClass convert_to(int v , boost::conversion::dummy::type_tag<EnumClass> const& ) { return EnumClass::convert_to(v); }
+ inline friend EnumClass convert_to(boost::enums::native_type<EnumClass>::type v , boost::conversion::dummy::type_tag<EnumClass> const& ) { return EnumClass::convert_to(v); }
+ inline friend int convert_to(EnumClass v , boost::conversion::dummy::type_tag<int> const& ) { return boost::enums::underlying_value(v); }
+ inline friend boost::enums::native_type<EnumClass>::type convert_to(EnumClass v , boost::conversion::dummy::type_tag<boost::enums::native_type<EnumClass>::type> const& ) {
     return boost::enums::native_value(v);
   }
   friend inline bool operator ==(EnumClass lhs, EnumClass rhs) { return lhs.native_value() == rhs.native_value(); }

Modified: sandbox/enums/libs/enums/test/EnumType.hpp
==============================================================================
--- sandbox/enums/libs/enums/test/EnumType.hpp (original)
+++ sandbox/enums/libs/enums/test/EnumType.hpp 2011-05-29 04:29:08 EDT (Sun, 29 May 2011)
@@ -56,7 +56,7 @@
 
 //! conversion from c-string.
 inline EnumClass convert_to(const char* str
- , boost::dummy::type_tag<EnumClass> const&
+ , boost::conversion::dummy::type_tag<EnumClass> const&
 )
 {
     if (strcmp(str, "Default") ==0) { return boost::conversion::convert_to<EnumClass>(EnumClass::Default); }
@@ -67,7 +67,7 @@
 
 //! conversion from std::string.
 inline EnumClass convert_to(const std::string& str
- , boost::dummy::type_tag<EnumClass> const&
+ , boost::conversion::dummy::type_tag<EnumClass> const&
 )
 {
     return boost::conversion::convert_to<EnumClass>(str.c_str());

Modified: sandbox/enums/libs/enums/test/enum_class/enum_inside_union_cons.pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/enum_inside_union_cons.pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/enum_inside_union_cons.pass.cpp 2011-05-29 04:29:08 EDT (Sun, 29 May 2011)
@@ -125,9 +125,9 @@
             //~ }
             //~ }
 //~ namespace Ex {
- //~ inline EC_Cons convert_to(int v , boost::dummy::type_tag<EC_Cons> const& ) { return EC_Cons(v); }
- //~ inline EC_Cons convert_to(boost::enums::native_type<EC_Cons>::type v , boost::dummy::type_tag<EC_Cons> const& ) { return v; }
- //~ inline int convert_to(EC_Cons v , boost::dummy::type_tag<int> const& ) { return boost::enums::underlying_value(v); }
+ //~ inline EC_Cons convert_to(int v , boost::conversion::dummy::type_tag<EC_Cons> const& ) { return EC_Cons(v); }
+ //~ inline EC_Cons convert_to(boost::enums::native_type<EC_Cons>::type v , boost::conversion::dummy::type_tag<EC_Cons> const& ) { return v; }
+ //~ inline int convert_to(EC_Cons v , boost::conversion::dummy::type_tag<int> const& ) { return boost::enums::underlying_value(v); }
 //~ }
             //~ namespace boost {
               //~ namespace enums {
@@ -144,8 +144,8 @@
                     //~ }
                     //~ }
                     //~ namespace Ex {
- //~ inline EC_Cons convert_to( const char* str, boost::dummy::type_tag<EC_Cons> const& ) { if (strcmp( str, "E0" ) == 0) { return boost::conversion::convert_to<EC_Cons>( EC_Cons::E0 ); } if (strcmp( str, "E1" ) == 0) { return boost::conversion::convert_to<EC_Cons>( EC_Cons::E1 ); } if (strcmp( str, "E2" ) == 0) { return boost::conversion::convert_to<EC_Cons>( EC_Cons::E2 ); } throw "invalid string for " "EC_Cons"; }
- //~ inline EC_Cons convert_to( const std::string& str, boost::dummy::type_tag<EC_Cons> const& ) { return boost::conversion::convert_to<EC_Cons>( str.c_str() ); }
+ //~ inline EC_Cons convert_to( const char* str, boost::conversion::dummy::type_tag<EC_Cons> const& ) { if (strcmp( str, "E0" ) == 0) { return boost::conversion::convert_to<EC_Cons>( EC_Cons::E0 ); } if (strcmp( str, "E1" ) == 0) { return boost::conversion::convert_to<EC_Cons>( EC_Cons::E1 ); } if (strcmp( str, "E2" ) == 0) { return boost::conversion::convert_to<EC_Cons>( EC_Cons::E2 ); } throw "invalid string for " "EC_Cons"; }
+ //~ inline EC_Cons convert_to( const std::string& str, boost::conversion::dummy::type_tag<EC_Cons> const& ) { return boost::conversion::convert_to<EC_Cons>( str.c_str() ); }
                         //~ inline const char* c_str(EC_Cons e) {
                           //~ switch (boost::enums::native_value(e)) {
                             //~ case EC_Cons::E0 : return("E0");


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