|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72252 - in sandbox/enums/libs/enums/test: . enum_class enum_class/cons enum_class/conversion enum_set enum_type/cons enum_type/conversion pp
From: vicente.botet_at_[hidden]
Date: 2011-05-28 16:10:18
Author: viboes
Date: 2011-05-28 16:10:17 EDT (Sat, 28 May 2011)
New Revision: 72252
URL: http://svn.boost.org/trac/boost/changeset/72252
Log:
Enums: Adapt to ne conversion namespace
Text files modified:
sandbox/enums/libs/enums/test/EnumClass.cpp | 1 +
sandbox/enums/libs/enums/test/EnumType.hpp | 8 ++++----
sandbox/enums/libs/enums/test/enum_class/cons/from_enum_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/conversion/explicit_conversion_from_valid_int_pass.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_class/enum_inside_union_cons.pass.cpp | 4 ++--
sandbox/enums/libs/enums/test/enum_set/constructible_from_enum.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_type/cons/from_enum_pass.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_type/conversion/explicit_conversion_from_invalid_int_fail.cpp | 2 +-
sandbox/enums/libs/enums/test/enum_type/conversion/explicit_conversion_from_valid_int_pass.cpp | 2 +-
sandbox/enums/libs/enums/test/pp/enumerator_definition.pass.cpp | 6 +++---
11 files changed, 17 insertions(+), 16 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-05-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -25,6 +25,7 @@
int main() {
using namespace boost;
+ using namespace boost::conversion;
using namespace boost::enums;
std::cout << __LINE__ << std::endl;
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-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -59,9 +59,9 @@
, boost::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); }
+ if (strcmp(str, "Default") ==0) { return boost::conversion::convert_to<EnumClass>(EnumClass::Default); }
+ if (strcmp(str, "Enum1") ==0) { return boost::conversion::convert_to<EnumClass>(EnumClass::Enum1); }
+ if (strcmp(str, "Enum2") ==0) { return boost::conversion::convert_to<EnumClass>(EnumClass::Enum2); }
throw "invalid string for EnumClass";
}
@@ -70,7 +70,7 @@
, boost::dummy::type_tag<EnumClass> const&
)
{
- return boost::convert_to<EnumClass>(str.c_str());
+ return boost::conversion::convert_to<EnumClass>(str.c_str());
}
//!explicit conversion to c-string.
Modified: sandbox/enums/libs/enums/test/enum_class/cons/from_enum_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/cons/from_enum_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/cons/from_enum_pass.cpp 2011-05-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -21,7 +21,7 @@
BOOST_TEST(e==EnumClass::Enum2);
}
{ // copy constructor emulation
- EnumClass e1=boost::convert_to<EnumClass>(EnumClass::Enum2);
+ EnumClass e1=boost::conversion::convert_to<EnumClass>(EnumClass::Enum2);
EnumClass e2=e1;
BOOST_TEST(e2==EnumClass::Enum2);
}
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-05-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -17,7 +17,7 @@
using namespace boost::enums;
{ // Explicit conversion from invalid int results in run-time error (undefined behavior)
- EnumClass e(boost::convert_to<EnumClass>((unsigned char)(6)));
+ EnumClass e(boost::conversion::convert_to<EnumClass>((unsigned char)(6)));
BOOST_TEST((unsigned char)(native_value(e))==(unsigned char)(6));
}
Modified: sandbox/enums/libs/enums/test/enum_class/conversion/explicit_conversion_from_valid_int_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_class/conversion/explicit_conversion_from_valid_int_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_class/conversion/explicit_conversion_from_valid_int_pass.cpp 2011-05-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -17,7 +17,7 @@
using namespace boost::enums;
{ // Explicit conversion from valid int works
- EnumClass e(boost::convert_to<EnumClass>((unsigned char)(4)));
+ EnumClass e(boost::conversion::convert_to<EnumClass>((unsigned char)(4)));
BOOST_TEST(e==EnumClass::Enum1);
}
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-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -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::convert_to<EC_Cons>( EC_Cons::E0 ); } if (strcmp( str, "E1" ) == 0) { return boost::convert_to<EC_Cons>( EC_Cons::E1 ); } if (strcmp( str, "E2" ) == 0) { return boost::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::convert_to<EC_Cons>( str.c_str() ); }
+ //~ 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 const char* c_str(EC_Cons e) {
//~ switch (boost::enums::native_value(e)) {
//~ case EC_Cons::E0 : return("E0");
Modified: sandbox/enums/libs/enums/test/enum_set/constructible_from_enum.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_set/constructible_from_enum.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_set/constructible_from_enum.cpp 2011-05-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -21,7 +21,7 @@
BOOST_TEST(e==EnumClass::Enum2);
}
{ // copy constructor emulation
- EnumClass e1=boost::convert_to<EnumClass>(EnumClass::Enum2);
+ EnumClass e1=boost::conversion::convert_to<EnumClass>(EnumClass::Enum2);
EnumClass e2=e1;
BOOST_TEST(e2==EnumClass::Enum2);
}
Modified: sandbox/enums/libs/enums/test/enum_type/cons/from_enum_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/cons/from_enum_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/cons/from_enum_pass.cpp 2011-05-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -21,7 +21,7 @@
BOOST_TEST(e==EnumClass::Enum2);
}
{ // copy constructor emulation
- EnumClass e1=boost::convert_to<EnumClass>(EnumClass::Enum2);
+ EnumClass e1=boost::conversion::convert_to<EnumClass>(EnumClass::Enum2);
EnumClass e2=e1;
BOOST_TEST(e2==EnumClass::Enum2);
}
Modified: sandbox/enums/libs/enums/test/enum_type/conversion/explicit_conversion_from_invalid_int_fail.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/conversion/explicit_conversion_from_invalid_int_fail.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/conversion/explicit_conversion_from_invalid_int_fail.cpp 2011-05-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -17,7 +17,7 @@
using namespace boost::enums;
{ // Explicit conversion from invalid int results in run-time error (undefined behavior)
- EnumClass e(boost::convert_to<EnumClass>((unsigned char)(6)));
+ EnumClass e(boost::conversion::convert_to<EnumClass>((unsigned char)(6)));
BOOST_TEST((unsigned char)(native_value(e))==(unsigned char)(6));
}
Modified: sandbox/enums/libs/enums/test/enum_type/conversion/explicit_conversion_from_valid_int_pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_type/conversion/explicit_conversion_from_valid_int_pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_type/conversion/explicit_conversion_from_valid_int_pass.cpp 2011-05-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -17,7 +17,7 @@
using namespace boost::enums;
{ // Explicit conversion from valid int works
- EnumClass e(boost::convert_to<EnumClass>((unsigned char)(4)));
+ EnumClass e(boost::conversion::convert_to<EnumClass>((unsigned char)(4)));
BOOST_TEST(e==EnumClass::Enum1);
}
Modified: sandbox/enums/libs/enums/test/pp/enumerator_definition.pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/pp/enumerator_definition.pass.cpp (original)
+++ sandbox/enums/libs/enums/test/pp/enumerator_definition.pass.cpp 2011-05-28 16:10:17 EDT (Sat, 28 May 2011)
@@ -14,8 +14,8 @@
enum Ex {
- BOOST_ENUMS_ENUMERATOR_DEFINITION_CPP_ENUMERATOR_DEFINITION((E0)(3)),
- BOOST_ENUMS_ENUMERATOR_DEFINITION_CPP_ENUMERATOR_DEFINITION((E1)),
- BOOST_ENUMS_ENUMERATOR_DEFINITION_CPP_ENUMERATOR_DEFINITION((E2)(7)(e2))
+ BOOST_ENUMS_ENUMERATOR_DEFINITION_CPP_ENUMERATOR_DEFINITION( (E0)(3) ),
+ BOOST_ENUMS_ENUMERATOR_DEFINITION_CPP_ENUMERATOR_DEFINITION( (E1) ),
+ BOOST_ENUMS_ENUMERATOR_DEFINITION_CPP_ENUMERATOR_DEFINITION( (E2)(7)(e2) )
};
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