|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75056 - in sandbox/enums/boost/enums: mpl ordinal pp
From: vicente.botet_at_[hidden]
Date: 2011-10-18 17:40:23
Author: viboes
Date: 2011-10-18 17:40:22 EDT (Tue, 18 Oct 2011)
New Revision: 75056
URL: http://svn.boost.org/trac/boost/changeset/75056
Log:
Enums: Fix issue using typename native_type<EC>::type as template parameter + some typos
Text files modified:
sandbox/enums/boost/enums/mpl/enum_c.hpp | 6 ++++--
sandbox/enums/boost/enums/ordinal/first.hpp | 2 ++
sandbox/enums/boost/enums/ordinal/last.hpp | 2 +-
sandbox/enums/boost/enums/ordinal/pos.hpp | 5 +++--
sandbox/enums/boost/enums/ordinal/pred.hpp | 2 +-
sandbox/enums/boost/enums/ordinal/succ.hpp | 2 +-
sandbox/enums/boost/enums/pp/enum_declaration.hpp | 1 +
7 files changed, 13 insertions(+), 7 deletions(-)
Modified: sandbox/enums/boost/enums/mpl/enum_c.hpp
==============================================================================
--- sandbox/enums/boost/enums/mpl/enum_c.hpp (original)
+++ sandbox/enums/boost/enums/mpl/enum_c.hpp 2011-10-18 17:40:22 EDT (Tue, 18 Oct 2011)
@@ -20,10 +20,12 @@
namespace boost {
namespace mpl {
- template <typename EC, typename enums::native_type<EC>::type V>
+ //template <typename EC, typename enums::native_type<EC>::type V>
+ template <typename EC, int V>
struct enum_c {
typedef enum_c_tag tag;
- BOOST_STATIC_CONSTEXPR typename enums::native_type<EC>::type value = V;
+ typedef typename enums::native_type<EC>::type native_type;
+ BOOST_STATIC_CONSTEXPR typename enums::native_type<EC>::type value = native_type(V);
typedef enum_c type;
typedef typename enums::native_type<EC>::type value_type;
typedef typename enums::underlying_type<EC>::type underlying_type;
Modified: sandbox/enums/boost/enums/ordinal/first.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/first.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/first.hpp 2011-10-18 17:40:22 EDT (Tue, 18 Oct 2011)
@@ -14,6 +14,8 @@
#ifndef BOOST_ENUMS_ORDINAL_FIRST_HPP
#define BOOST_ENUMS_ORDINAL_FIRST_HPP
+
+#include <boost/enums/config.hpp>
#include <boost/enums/scoped/native_type.hpp>
#include <boost/enums/ordinal/val.hpp>
Modified: sandbox/enums/boost/enums/ordinal/last.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/last.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/last.hpp 2011-10-18 17:40:22 EDT (Tue, 18 Oct 2011)
@@ -30,7 +30,7 @@
{
namespace meta
{
- //! meta-function: first element of an enumeration
+ //! meta-function: last element of an enumeration
template <typename EC>
struct last
{
Modified: sandbox/enums/boost/enums/ordinal/pos.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/pos.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/pos.hpp 2011-10-18 17:40:22 EDT (Tue, 18 Oct 2011)
@@ -37,7 +37,8 @@
//! @Note This meta-function must be specialized for each element of the enumeration.
#ifdef BOOST_NO_SCOPED_ENUMS
- template <typename EC, typename native_type<EC>::type V>
+ //template <typename EC, typename native_type<EC>::type V>
+ template <typename EC, int V>
#else
template <typename EC, EC V>
#endif
@@ -65,7 +66,7 @@
//! @Returns the associated position
//! @No_Throw
template <typename EC>
- std::size_t pos(EC e)
+ BOOST_CONSTEXPR std::size_t pos(EC e)
{
return meta::enum_traits<EC>::pos(e);
}
Modified: sandbox/enums/boost/enums/ordinal/pred.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/pred.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/pred.hpp 2011-10-18 17:40:22 EDT (Tue, 18 Oct 2011)
@@ -51,7 +51,7 @@
template <typename EC>
BOOST_CONSTEXPR EC pred(EC e)
{
- BOOSt_ASSERT(pos(e)!=0);
+ BOOST_ASSERT(pos(e)!=0);
return val<EC>(pos(e)-1);
}
}
Modified: sandbox/enums/boost/enums/ordinal/succ.hpp
==============================================================================
--- sandbox/enums/boost/enums/ordinal/succ.hpp (original)
+++ sandbox/enums/boost/enums/ordinal/succ.hpp 2011-10-18 17:40:22 EDT (Tue, 18 Oct 2011)
@@ -54,7 +54,7 @@
template <typename EC>
EC succ(EC e)
{
- BOOSt_ASSERT(pos(e)!=(meta::size<EC>::value-1));
+ BOOST_ASSERT(pos(e)!=(meta::size<EC>::value-1));
return val<EC>(pos(e)+1);
}
}
Modified: sandbox/enums/boost/enums/pp/enum_declaration.hpp
==============================================================================
--- sandbox/enums/boost/enums/pp/enum_declaration.hpp (original)
+++ sandbox/enums/boost/enums/pp/enum_declaration.hpp 2011-10-18 17:40:22 EDT (Tue, 18 Oct 2011)
@@ -14,6 +14,7 @@
#define BOOST_ENUMS_PP_ENUM_DECLARATION_HPP
+#include <boost/enums/config.hpp>
#include <boost/enums/pp/enumerator_list.hpp>
#include <boost/enums/pp/namespaces.hpp>
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