replace standard check with proper macro

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 1 year ago
parent 18a981e895
commit 10da107fe8

@ -255,7 +255,7 @@ struct ContainerStorage {
using iterator = typename container::iterator; using iterator = typename container::iterator;
using const_iterator = typename container::const_iterator; using const_iterator = typename container::const_iterator;
#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L)) #ifdef __cpp_lib_type_trait_variable_templates
using value_type = std::remove_cv_t<typename container::value_type>; using value_type = std::remove_cv_t<typename container::value_type>;
#else #else
using value_type = typename std::remove_cv<typename container::value_type>::type; using value_type = typename std::remove_cv<typename container::value_type>::type;
@ -320,7 +320,7 @@ struct ContainerStorage {
*/ */
template <typename storage_type> template <typename storage_type>
struct PtrSliceStorage { struct PtrSliceStorage {
#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L)) #ifdef __cpp_lib_type_trait_variable_templates
using value_type = std::remove_cv_t<std::remove_pointer_t<storage_type>>; using value_type = std::remove_cv_t<std::remove_pointer_t<storage_type>>;
#else #else
using value_type = typename std::remove_cv<typename std::remove_pointer<storage_type>::type>::type; using value_type = typename std::remove_cv<typename std::remove_pointer<storage_type>::type>::type;
@ -423,7 +423,7 @@ struct Slice : public Internal::MutableSliceBase<Internal::ContainerStorage, con
using iterator = typename container::iterator; using iterator = typename container::iterator;
using const_iterator = typename container::const_iterator; using const_iterator = typename container::const_iterator;
#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L)) #ifdef __cpp_lib_type_trait_variable_templates
using value_type = std::remove_cv_t<typename container::value_type>; using value_type = std::remove_cv_t<typename container::value_type>;
#else #else
using value_type = typename std::remove_cv<typename container::value_type>::type; using value_type = typename std::remove_cv<typename container::value_type>::type;
@ -460,7 +460,7 @@ struct Slice<const container> : public Internal::ConstSliceBase<Internal::Contai
using iterator = typename container::iterator; using iterator = typename container::iterator;
using const_iterator = typename container::const_iterator; using const_iterator = typename container::const_iterator;
#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L)) #ifdef __cpp_lib_type_trait_variable_templates
using value_type = std::remove_cv_t<typename container::value_type>; using value_type = std::remove_cv_t<typename container::value_type>;
#else #else
using value_type = typename std::remove_cv<typename container::value_type>::type; using value_type = typename std::remove_cv<typename container::value_type>::type;

@ -1254,7 +1254,7 @@ class ValueType : public Value {
} else if (std::is_signed<I>::value) { } else if (std::is_signed<I>::value) {
#endif #endif
// conversion is from unsigned to signed // conversion is from unsigned to signed
#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L)) #ifdef __cpp_lib_type_trait_variable_templates
const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max()); const auto imax = static_cast<std::make_unsigned_t<I>>(std::numeric_limits<I>::max());
#else #else
const auto imax = static_cast<typename std::make_unsigned<I>::type>(std::numeric_limits<I>::max()); const auto imax = static_cast<typename std::make_unsigned<I>::type>(std::numeric_limits<I>::max());
@ -1269,7 +1269,7 @@ class ValueType : public Value {
return 0; return 0;
} }
// Inputs are not negative so convert them to unsigned. // Inputs are not negative so convert them to unsigned.
#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L)) #ifdef __cpp_lib_type_trait_variable_templates
const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a); const auto a_u = static_cast<std::make_unsigned_t<decltype(a)>>(a);
const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b); const auto b_u = static_cast<std::make_unsigned_t<decltype(b)>>(b);
#else #else

Loading…
Cancel
Save