14 #ifndef COVEO_ENUMERABLE_DETAIL_H 15 #define COVEO_ENUMERABLE_DETAIL_H 20 #include <type_traits> 39 static_assert(
sizeof(std::int_least8_t) !=
sizeof(std::int_least32_t),
40 "has_begin only works if int_least8_t has a different size than int_least32_t");
42 template<
typename C>
static std::int_least8_t test(
decltype(std::begin(std::declval<C>()))*);
43 template<
typename C>
static std::int_least32_t test(...);
45 static constexpr bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(std::int_least8_t);
61 static_assert(
sizeof(std::int_least8_t) !=
sizeof(std::int_least32_t),
62 "has_end only works if int_least8_t has a different size than int_least32_t");
64 template<
typename C>
static std::int_least8_t test(
decltype(std::end(std::declval<C>()))*);
65 template<
typename C>
static std::int_least32_t test(...);
67 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(std::int_least8_t);
81 class has_size_const_method
83 static_assert(
sizeof(std::int_least8_t) !=
sizeof(std::int_least32_t),
84 "has_size_const_method only works if int_least8_t has a different size than int_least32_t");
86 template<
typename C>
static std::int_least8_t test(
typename std::enable_if<!std::is_void<
decltype(std::declval<
const C>().size())>::value,
void*>::type);
87 template<
typename C>
static std::int_least32_t test(...);
89 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(std::int_least8_t);