drop static in constexpr template vars

This commit is contained in:
q66 2016-01-13 20:40:59 +00:00
parent 818cbe376a
commit 41174195bb
2 changed files with 63 additions and 64 deletions

View file

@ -85,7 +85,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsInputRange = detail::IsInputRangeBase<T>::value; constexpr bool IsInputRange = detail::IsInputRangeBase<T>::value;
// is forward range // is forward range
@ -104,7 +104,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsForwardRange = detail::IsForwardRangeBase<T>::value; constexpr bool IsForwardRange = detail::IsForwardRangeBase<T>::value;
// is bidirectional range // is bidirectional range
@ -124,7 +124,7 @@ namespace detail {
detail::IsBidirectionalRangeCore<T>::Type {}; detail::IsBidirectionalRangeCore<T>::Type {};
} }
template<typename T> static constexpr bool IsBidirectionalRange template<typename T> constexpr bool IsBidirectionalRange
= detail::IsBidirectionalRangeBase<T>::value; = detail::IsBidirectionalRangeBase<T>::value;
// is random access range // is random access range
@ -145,7 +145,7 @@ namespace detail {
detail::IsRandomAccessRangeCore<T>::Type {}; detail::IsRandomAccessRangeCore<T>::Type {};
} }
template<typename T> static constexpr bool IsRandomAccessRange template<typename T> constexpr bool IsRandomAccessRange
= detail::IsRandomAccessRangeBase<T>::value; = detail::IsRandomAccessRangeBase<T>::value;
// is finite random access range // is finite random access range
@ -166,12 +166,12 @@ namespace detail {
detail::IsFiniteRandomAccessRangeCore<T>::Type {}; detail::IsFiniteRandomAccessRangeCore<T>::Type {};
} }
template<typename T> static constexpr bool IsFiniteRandomAccessRange template<typename T> constexpr bool IsFiniteRandomAccessRange
= detail::IsFiniteRandomAccessRangeBase<T>::value; = detail::IsFiniteRandomAccessRangeBase<T>::value;
// is infinite random access range // is infinite random access range
template<typename T> static constexpr bool IsInfiniteRandomAccessRange template<typename T> constexpr bool IsInfiniteRandomAccessRange
= IsRandomAccessRange<T> && !IsFiniteRandomAccessRange<T>; = IsRandomAccessRange<T> && !IsFiniteRandomAccessRange<T>;
// is contiguous range // is contiguous range
@ -192,7 +192,7 @@ namespace detail {
detail::IsContiguousRangeCore<T>::Type {}; detail::IsContiguousRangeCore<T>::Type {};
} }
template<typename T> static constexpr bool IsContiguousRange template<typename T> constexpr bool IsContiguousRange
= detail::IsContiguousRangeBase<T>::value; = detail::IsContiguousRangeBase<T>::value;
// is output range // is output range
@ -225,7 +225,7 @@ namespace detail {
detail::IsOutputRangeCore<T>::Type {}; detail::IsOutputRangeCore<T>::Type {};
} }
template<typename T> static constexpr bool IsOutputRange template<typename T> constexpr bool IsOutputRange
= detail::IsOutputRangeBase<T>::value; = detail::IsOutputRangeBase<T>::value;
namespace detail { namespace detail {

View file

@ -116,17 +116,17 @@ namespace detail {
} }
template<typename T, typename U> template<typename T, typename U>
static constexpr bool IsSame = detail::IsSameBase<T, U>::value; constexpr bool IsSame = detail::IsSameBase<T, U>::value;
/* is void */ /* is void */
template<typename T> template<typename T>
static constexpr bool IsVoid = IsSame<RemoveCv<T>, void>; constexpr bool IsVoid = IsSame<RemoveCv<T>, void>;
/* is null pointer */ /* is null pointer */
template<typename T> template<typename T>
static constexpr bool IsNullPointer = IsSame<RemoveCv<T>, Nullptr>; constexpr bool IsNullPointer = IsSame<RemoveCv<T>, Nullptr>;
/* is integer */ /* is integer */
@ -153,7 +153,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsIntegral = detail::IsIntegralBase<RemoveCv<T>>::value; constexpr bool IsIntegral = detail::IsIntegralBase<RemoveCv<T>>::value;
/* is floating point */ /* is floating point */
@ -167,7 +167,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsFloatingPoint = detail::IsFloatingPointBase<RemoveCv<T>>::value; constexpr bool IsFloatingPoint = detail::IsFloatingPointBase<RemoveCv<T>>::value;
/* is array */ /* is array */
@ -178,7 +178,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsArray = detail::IsArrayBase<T>::value; constexpr bool IsArray = detail::IsArrayBase<T>::value;
/* is pointer */ /* is pointer */
@ -188,7 +188,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsPointer = detail::IsPointerBase<RemoveCv<T>>::value; constexpr bool IsPointer = detail::IsPointerBase<RemoveCv<T>>::value;
/* is lvalue reference */ /* is lvalue reference */
@ -198,7 +198,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsLvalueReference = detail::IsLvalueReferenceBase<T>::value; constexpr bool IsLvalueReference = detail::IsLvalueReferenceBase<T>::value;
/* is rvalue reference */ /* is rvalue reference */
@ -208,24 +208,24 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsRvalueReference = detail::IsRvalueReferenceBase<T>::value; constexpr bool IsRvalueReference = detail::IsRvalueReferenceBase<T>::value;
/* is reference */ /* is reference */
template<typename T> template<typename T>
static constexpr bool IsReference = IsLvalueReference<T> || IsRvalueReference<T>; constexpr bool IsReference = IsLvalueReference<T> || IsRvalueReference<T>;
/* is enum */ /* is enum */
template<typename T> static constexpr bool IsEnum = __is_enum(T); template<typename T> constexpr bool IsEnum = __is_enum(T);
/* is union */ /* is union */
template<typename T> static constexpr bool IsUnion = __is_union(T); template<typename T> constexpr bool IsUnion = __is_union(T);
/* is class */ /* is class */
template<typename T> static constexpr bool IsClass = __is_class(T); template<typename T> constexpr bool IsClass = __is_class(T);
/* is function */ /* is function */
@ -252,23 +252,22 @@ namespace detail {
} /* namespace detail */ } /* namespace detail */
template<typename T> template<typename T>
static constexpr bool IsFunction = detail::IsFunctionBase<T>::value; constexpr bool IsFunction = detail::IsFunctionBase<T>::value;
/* is arithmetic */ /* is arithmetic */
template<typename T> template<typename T>
static constexpr bool IsArithmetic = IsIntegral<T> || IsFloatingPoint<T>; constexpr bool IsArithmetic = IsIntegral<T> || IsFloatingPoint<T>;
/* is fundamental */ /* is fundamental */
template<typename T> template<typename T>
static constexpr bool IsFundamental = IsArithmetic<T> || IsVoid<T> || constexpr bool IsFundamental = IsArithmetic<T> || IsVoid<T> || IsNullPointer<T>;
IsNullPointer<T>;
/* is compound */ /* is compound */
template<typename T> template<typename T>
static constexpr bool IsCompound = !IsFundamental<T>; constexpr bool IsCompound = !IsFundamental<T>;
/* is pointer to member */ /* is pointer to member */
@ -281,7 +280,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsMemberPointer = detail::IsMemberPointerBase<RemoveCv<T>>::value; constexpr bool IsMemberPointer = detail::IsMemberPointerBase<RemoveCv<T>>::value;
/* is pointer to member object */ /* is pointer to member object */
@ -296,7 +295,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsMemberObjectPointer = detail::IsMemberObjectPointerBase<RemoveCv<T>>::value; constexpr bool IsMemberObjectPointer = detail::IsMemberObjectPointerBase<RemoveCv<T>>::value;
/* is pointer to member function */ /* is pointer to member function */
@ -311,44 +310,44 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsMemberFunctionPointer = detail::IsMemberFunctionPointerBase<RemoveCv<T>>::value; constexpr bool IsMemberFunctionPointer = detail::IsMemberFunctionPointerBase<RemoveCv<T>>::value;
/* is object */ /* is object */
template<typename T> template<typename T>
static constexpr bool IsObject = !IsFunction<T> && !IsVoid<T> && !IsReference<T>; constexpr bool IsObject = !IsFunction<T> && !IsVoid<T> && !IsReference<T>;
/* is scalar */ /* is scalar */
template<typename T> static constexpr bool IsScalar template<typename T> constexpr bool IsScalar
= IsMemberPointer<T> || IsPointer<T> || IsEnum<T> || = IsMemberPointer<T> || IsPointer<T> || IsEnum<T> ||
IsNullPointer <T> || IsArithmetic<T>; IsNullPointer <T> || IsArithmetic<T>;
/* is abstract */ /* is abstract */
template<typename T> static constexpr bool IsAbstract = __is_abstract(T); template<typename T> constexpr bool IsAbstract = __is_abstract(T);
/* is const */ /* is const */
template<typename T> template<typename T>
static constexpr bool IsConst = IsSame<T, const T>; constexpr bool IsConst = IsSame<T, const T>;
/* is volatile */ /* is volatile */
template<typename T> template<typename T>
static constexpr bool IsVolatile = IsSame<T, volatile T>; constexpr bool IsVolatile = IsSame<T, volatile T>;
/* is empty */ /* is empty */
template<typename T> static constexpr bool IsEmpty = __is_empty(T); template<typename T> constexpr bool IsEmpty = __is_empty(T);
/* is POD */ /* is POD */
template<typename T> static constexpr bool IsPod = __is_pod(T); template<typename T> constexpr bool IsPod = __is_pod(T);
/* is polymorphic */ /* is polymorphic */
template<typename T> static constexpr bool IsPolymorphic = __is_polymorphic(T); template<typename T> constexpr bool IsPolymorphic = __is_polymorphic(T);
/* is signed */ /* is signed */
@ -364,7 +363,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsSigned = detail::IsSignedBase<T>::value; constexpr bool IsSigned = detail::IsSignedBase<T>::value;
/* is unsigned */ /* is unsigned */
@ -380,31 +379,31 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr bool IsUnsigned = detail::IsUnsignedBase<T>::value; constexpr bool IsUnsigned = detail::IsUnsignedBase<T>::value;
/* is standard layout */ /* is standard layout */
template<typename T> template<typename T>
static constexpr bool IsStandardLayout = __is_standard_layout(T); constexpr bool IsStandardLayout = __is_standard_layout(T);
/* is literal type */ /* is literal type */
template<typename T> template<typename T>
static constexpr bool IsLiteralType = __is_literal_type(T); constexpr bool IsLiteralType = __is_literal_type(T);
/* is trivially copyable */ /* is trivially copyable */
template<typename T> template<typename T>
static constexpr bool IsTriviallyCopyable = IsScalar<RemoveAllExtents<T>>; constexpr bool IsTriviallyCopyable = IsScalar<RemoveAllExtents<T>>;
/* is trivial */ /* is trivial */
template<typename T> static constexpr bool IsTrivial = __is_trivial(T); template<typename T> constexpr bool IsTrivial = __is_trivial(T);
/* has virtual destructor */ /* has virtual destructor */
template<typename T> template<typename T>
static constexpr bool HasVirtualDestructor = __has_virtual_destructor(T); constexpr bool HasVirtualDestructor = __has_virtual_destructor(T);
/* is constructible */ /* is constructible */
@ -493,24 +492,24 @@ namespace detail {
} /* namespace detail */ } /* namespace detail */
template<typename T, typename ...A> template<typename T, typename ...A>
static constexpr bool IsConstructible = detail::Ctible<T, A...>::value; constexpr bool IsConstructible = detail::Ctible<T, A...>::value;
/* is default constructible */ /* is default constructible */
template<typename T> template<typename T>
static constexpr bool IsDefaultConstructible = IsConstructible<T>; constexpr bool IsDefaultConstructible = IsConstructible<T>;
/* is copy constructible */ /* is copy constructible */
template<typename T> template<typename T>
static constexpr bool IsCopyConstructible = IsConstructible<T, constexpr bool IsCopyConstructible = IsConstructible<T,
AddLvalueReference<AddConst<T>> AddLvalueReference<AddConst<T>>
>; >;
/* is move constructible */ /* is move constructible */
template<typename T> template<typename T>
static constexpr bool IsMoveConstructible = IsConstructible<T, constexpr bool IsMoveConstructible = IsConstructible<T,
AddRvalueReference<T> AddRvalueReference<T>
>; >;
@ -533,12 +532,12 @@ namespace detail {
} /* namespace detail */ } /* namespace detail */
template<typename T, typename U> template<typename T, typename U>
static constexpr bool IsAssignable = detail::IsAssignableBase<T, U>::value; constexpr bool IsAssignable = detail::IsAssignableBase<T, U>::value;
/* is copy assignable */ /* is copy assignable */
template<typename T> template<typename T>
static constexpr bool IsCopyAssignable = IsAssignable< constexpr bool IsCopyAssignable = IsAssignable<
AddLvalueReference<T>, AddLvalueReference<T>,
AddLvalueReference<AddConst<T>> AddLvalueReference<AddConst<T>>
>; >;
@ -546,7 +545,7 @@ static constexpr bool IsCopyAssignable = IsAssignable<
/* is move assignable */ /* is move assignable */
template<typename T> template<typename T>
static constexpr bool IsMoveAssignable = IsAssignable< constexpr bool IsMoveAssignable = IsAssignable<
AddLvalueReference<T>, AddLvalueReference<T>,
const AddRvalueReference<T> const AddRvalueReference<T>
>; >;
@ -591,7 +590,7 @@ namespace detail {
} /* namespace detail */ } /* namespace detail */
template<typename T> template<typename T>
static constexpr bool IsDestructible = detail::IsDestructibleBase<T>::value; constexpr bool IsDestructible = detail::IsDestructibleBase<T>::value;
/* is trivially constructible */ /* is trivially constructible */
@ -621,22 +620,22 @@ namespace detail {
} /* namespace detail */ } /* namespace detail */
template<typename T, typename ...A> template<typename T, typename ...A>
static constexpr bool IsTriviallyConstructible constexpr bool IsTriviallyConstructible
= detail::IsTriviallyConstructibleBase<T, A...>::value; = detail::IsTriviallyConstructibleBase<T, A...>::value;
/* is trivially default constructible */ /* is trivially default constructible */
template<typename T> static constexpr bool IsTriviallyDefaultConstructible template<typename T> constexpr bool IsTriviallyDefaultConstructible
= IsTriviallyConstructible<T>; = IsTriviallyConstructible<T>;
/* is trivially copy constructible */ /* is trivially copy constructible */
template<typename T> static constexpr bool IsTriviallyCopyConstructible template<typename T> constexpr bool IsTriviallyCopyConstructible
= IsTriviallyConstructible<T, AddLvalueReference<const T>>; = IsTriviallyConstructible<T, AddLvalueReference<const T>>;
/* is trivially move constructible */ /* is trivially move constructible */
template<typename T> static constexpr bool IsTriviallyMoveConstructible template<typename T> constexpr bool IsTriviallyMoveConstructible
= IsTriviallyConstructible<T, AddRvalueReference<T>>; = IsTriviallyConstructible<T, AddRvalueReference<T>>;
/* is trivially assignable */ /* is trivially assignable */
@ -667,28 +666,28 @@ namespace detail {
} /* namespace detail */ } /* namespace detail */
template<typename T, typename ...A> template<typename T, typename ...A>
static constexpr bool IsTriviallyAssignable constexpr bool IsTriviallyAssignable
= detail::IsTriviallyAssignableBase<T>::value; = detail::IsTriviallyAssignableBase<T>::value;
/* is trivially copy assignable */ /* is trivially copy assignable */
template<typename T> static constexpr bool IsTriviallyCopyAssignable template<typename T> constexpr bool IsTriviallyCopyAssignable
= IsTriviallyAssignable<T, AddLvalueReference<const T>>; = IsTriviallyAssignable<T, AddLvalueReference<const T>>;
/* is trivially move assignable */ /* is trivially move assignable */
template<typename T> static constexpr bool IsTriviallyMoveAssignable template<typename T> constexpr bool IsTriviallyMoveAssignable
= IsTriviallyAssignable<T, AddRvalueReference<T>>; = IsTriviallyAssignable<T, AddRvalueReference<T>>;
/* is trivially destructible */ /* is trivially destructible */
template<typename T> template<typename T>
static constexpr bool IsTriviallyDestructible = __has_trivial_destructor(T); constexpr bool IsTriviallyDestructible = __has_trivial_destructor(T);
/* is base of */ /* is base of */
template<typename B, typename D> template<typename B, typename D>
static constexpr bool IsBaseOf = __is_base_of(B, D); constexpr bool IsBaseOf = __is_base_of(B, D);
/* is convertible */ /* is convertible */
@ -713,7 +712,7 @@ namespace detail {
}; };
} }
template<typename F, typename T> static constexpr bool IsConvertible template<typename F, typename T> constexpr bool IsConvertible
= detail::IsConvertibleBase<F, T>::Type::value; = detail::IsConvertibleBase<F, T>::Type::value;
/* extent */ /* extent */
@ -738,7 +737,7 @@ namespace detail {
} /* namespace detail */ } /* namespace detail */
template<typename T, uint I = 0> template<typename T, uint I = 0>
static constexpr Size Extent = detail::ExtentBase<T, I>::value; constexpr Size Extent = detail::ExtentBase<T, I>::value;
/* rank */ /* rank */
@ -753,7 +752,7 @@ namespace detail {
} }
template<typename T> template<typename T>
static constexpr Size Rank = detail::RankBase<T>::value; constexpr Size Rank = detail::RankBase<T>::value;
/* remove const, volatile, cv */ /* remove const, volatile, cv */