mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
minor style improvement:
traits class should have a static const bool value member
This commit is contained in:
@@ -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) \
|
||||
{ \
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user