16 #ifndef ABSL_TYPES_INTERNAL_SPAN_H_ 17 #define ABSL_TYPES_INTERNAL_SPAN_H_ 22 #include <type_traits> 30 namespace span_internal {
32 constexpr
size_t Min(
size_t a,
size_t b) noexcept {
return a <
b ?
a :
b; }
37 -> decltype(c.
data()) {
56 std::is_integral<absl::decay_t<decltype(std::declval<C&>().
size())>>;
64 template <
typename T,
typename C>
66 std::is_convertible<absl::decay_t<decltype(GetData(std::declval<C&>()))>*,
75 template <
typename T,
size_t N>
87 template <
template <
typename>
class SpanT,
typename T>
90 return absl::equal(a.begin(), a.end(), b.begin(), b.end());
93 template <
template <
typename>
class SpanT,
typename T>
98 return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end());
105 template <
typename From,
typename To>
108 static std::true_type testval(To);
109 static std::false_type testval(...);
112 using type = decltype(testval(std::declval<From>()));
115 template <
typename From,
typename To>
120 template <
typename From,
typename To>
126 #endif // ABSL_TYPES_INTERNAL_SPAN_H_ typename absl::remove_reference_t< C >::value_type type
std::is_integral< absl::decay_t< decltype(std::declval< C & >().size())>> HasSize
bool EqualImpl(SpanT< T > a, SpanT< T > b)
typename std::remove_reference< T >::type remove_reference_t
decltype(testval(std::declval< From >())) type
constexpr auto GetData(C &c) noexcept-> decltype(GetDataImpl(c, 0))
constexpr size_t Min(size_t a, size_t b) noexcept
typename std::enable_if< IsConvertible< From, To >::value >::type EnableIfConvertibleTo
static char data[kDataSize]
std::is_convertible< absl::decay_t< decltype(GetData(std::declval< C & >()))> *, T *const * > HasData
bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2, Pred &&pred)
typename std::enable_if<!std::is_const< T >::value, int >::type EnableIfMutable
constexpr auto GetDataImpl(C &c, char) noexcept-> decltype(c.data())
bool LessThanImpl(SpanT< T > a, SpanT< T > b)
typename ElementType< C >::type ElementT