Additional changes (mostly std:: prefixes) to make code compile outside of HRT context.

This commit is contained in:
Anton Bachin 2015-04-22 20:43:47 -04:00
parent 4d7aea0bbd
commit 91e5cb945c
2 changed files with 16 additions and 7 deletions

9
Enum.h
View File

@ -74,12 +74,15 @@
EnumType(_Value value) : _value(value) { } \
template <typename IntegralType> \
explicit EnumType(IntegralType value, \
typename enable_if<is_integral<IntegralType>::value> \
::type *dummy = nullptr) : _value(value) { } \
typename \
std::enable_if< \
std::is_integral<IntegralType>::value> \
::type *dummy = nullptr) : _value(value) \
{ } \
\
template <typename IntegralType> \
EnumType& operator =(IntegralType value) \
{ *this = EnumType(value); return *this; } \
{ *this = EnumType(value); return *this; } \
\
operator _Value () const { return (_Value)_value; } \
Underlying toUnderlying() const { return (Underlying)_value; } \

View File

@ -44,6 +44,8 @@
#include <cstddef> // For size_t.
#include <cstring> // For string and memory routines.
#include <type_traits>
#include "EnumPreprocessorMap.h"
@ -1106,6 +1108,7 @@ class _Internal : public _GeneratedArrays<EnumType> {
// failure.
if (result == _processedNames[_badIndex]) {
// TODO Throw an exception here.
return result;
}
else
return result;
@ -1127,8 +1130,10 @@ class _Internal : public _GeneratedArrays<EnumType> {
{
EnumType result = find(name);
if (result == (_Value)_values[_badIndex])
if (result == (_Value)_values[_badIndex]) {
// TODO Throw an exception here.
return result;
}
else
return result;
}
@ -1151,6 +1156,7 @@ class _Internal : public _GeneratedArrays<EnumType> {
if (result == (_Value)_values[_badIndex]) {
// TODO Throw an exception here.
return result;
}
else
return result;
@ -1165,10 +1171,10 @@ class _Internal : public _GeneratedArrays<EnumType> {
template <typename IntegralType>
static bool valid(IntegralType value)
{
static_assert(is_integral<IntegralType>::value,
static_assert(std::is_integral<IntegralType>::value,
"argument to EnumType::valid must have integral type");
static_assert(is_signed<IntegralType>::value ==
is_signed<Underlying>::value,
static_assert(std::is_signed<IntegralType>::value ==
std::is_signed<Underlying>::value,
"argument to EnumType::valid must be signed if and only "
"if underlying type of EnumType is signed");