|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r69548 - in sandbox/enums/libs/enums/test: . enum_set/cons
From: vicente.botet_at_[hidden]
Date: 2011-03-04 12:19:28
Author: viboes
Date: 2011-03-04 12:19:26 EST (Fri, 04 Mar 2011)
New Revision: 69548
URL: http://svn.boost.org/trac/boost/changeset/69548
Log:
Enums: warning cleanup
Text files modified:
sandbox/enums/libs/enums/test/EnumClass.hpp | 28 ++++++++++++++--------------
sandbox/enums/libs/enums/test/enum_set/cons/ull_ctor.pass.cpp | 2 +-
2 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-03-04 12:19:26 EST (Fri, 04 Mar 2011)
@@ -182,7 +182,7 @@
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); }
- assert(false && "invalid string for EnumClass");
+ throw "invalid string for EnumClass";
}
//! conversion from std::string.
@@ -214,45 +214,45 @@
struct size<EnumClass>
{
static const std::size_t value = 3;
- };
+ };
template <>
struct pos<EnumClass, EnumClass::Default>
{
static const std::size_t value = 0;
- };
+ };
template <>
struct pos<EnumClass, EnumClass::Enum1>
{
static const std::size_t value = 1;
- };
+ };
template <>
struct pos<EnumClass, EnumClass::Enum2>
{
static const std::size_t value = 2;
- };
+ };
template <>
struct val<EnumClass, 0>
{
static const boost::enums::enum_type<EnumClass>::type value = EnumClass::Default;
- };
+ };
template <>
struct val<EnumClass, 1>
{
static const boost::enums::enum_type<EnumClass>::type value = EnumClass::Enum1;
- };
+ };
template <>
struct val<EnumClass, 2>
{
static const boost::enums::enum_type<EnumClass>::type value = EnumClass::Enum2;
- };
+ };
} // namespace meta
template <>
- struct enum_traits<EnumClass> : enum_traiter<EnumClass>
+ struct enum_traits<EnumClass> : enum_traiter<EnumClass>
{
- static std::size_t pos(EnumClass e)
+ static std::size_t pos(EnumClass e)
{
- switch (boost::enums::get_value(e))
+ switch (boost::enums::get_value(e))
{
case EnumClass::Default: return 0;
case EnumClass::Enum1: return 1;
@@ -260,9 +260,9 @@
default: throw "bad_parameterparameter";
}
}
- static EnumClass val(std::size_t p)
+ static EnumClass val(std::size_t p)
{
- switch (p)
+ switch (p)
{
case 0: return boost::convert_to<EnumClass>(EnumClass::Default);
case 1: return boost::convert_to<EnumClass>(EnumClass::Enum1);
@@ -270,7 +270,7 @@
default: throw "bad_parameter";
}
}
- };
+ };
}
}
Modified: sandbox/enums/libs/enums/test/enum_set/cons/ull_ctor.pass.cpp
==============================================================================
--- sandbox/enums/libs/enums/test/enum_set/cons/ull_ctor.pass.cpp (original)
+++ sandbox/enums/libs/enums/test/enum_set/cons/ull_ctor.pass.cpp 2011-03-04 12:19:26 EST (Fri, 04 Mar 2011)
@@ -37,7 +37,7 @@
BOOST_TEST(v.size() == meta::size<EC>::value);
unsigned M = std::min<std::size_t>(meta::size<EC>::value, 64);
for (std::size_t i = 0; i < M; ++i)
- BOOST_TEST(v[val<EC>(i)] == ((i & 1)));
+ BOOST_TEST(v[val<EC>(i)] == ((i & 1)!=0));
for (std::size_t i = M; i < meta::size<EC>::value; ++i)
BOOST_TEST(v[val<EC>(i)] == false);
}
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