minor style improvement:

traits class should have a static const bool value member
This commit is contained in:
Mathew Sutcliffe
2014-03-23 21:01:53 +00:00
parent bfce2d186f
commit 6cf5089b18
2 changed files with 3 additions and 2 deletions

View File

@@ -49,7 +49,7 @@
template <> class TupleConverter<T> \
{ \
friend class T; \
static_assert(Private::HasEnabledTupleConversion<T>::type::value, \
static_assert(Private::HasEnabledTupleConversion<T>::value, \
"Missing BLACK_ENABLE_TUPLE_CONVERSION macro in " #T); \
static auto toTuple(const T &o) -> decltype(std::tie MEMBERS) \
{ \
@@ -78,7 +78,7 @@
template <class U> class TupleConverter<T<U>> \
{ \
friend class T<U>; \
static_assert(Private::HasEnabledTupleConversion<T<U>>::type::value,\
static_assert(Private::HasEnabledTupleConversion<T<U>>::value, \
"Missing BLACK_ENABLE_TUPLE_CONVERSION macro in " #T); \
static auto toTuple(const T<U> &o) -> decltype(std::tie MEMBERS) \
{ \

View File

@@ -41,6 +41,7 @@ namespace BlackMisc
struct HasEnabledTupleConversion
{
typedef decltype(hasEnabledTupleConversionHelper(static_cast<T *>(nullptr))) type;
static const bool value = type::value;
};
// Using tag dispatch to select which implementation of compare() to use