39 #ifndef ABSL_UTILITY_UTILITY_H_ 40 #define ABSL_UTILITY_UTILITY_H_ 73 template <
typename T, T... Ints>
76 static constexpr
size_t size() noexcept {
return sizeof...(Ints); }
84 template <
size_t... Ints>
87 namespace utility_internal {
89 template <
typename Seq,
size_t SeqSize,
size_t Rem>
93 template <
typename T, T... Ints,
size_t SeqSize>
98 template <
typename T, T... Ints,
size_t SeqSize>
105 template <
typename T,
size_t N>
111 template <
typename T>
116 template <
typename T>
139 template <
typename T, T N>
155 template <
typename... Ts>
160 #ifdef ABSL_HAVE_STD_OPTIONAL 162 using std::in_place_t;
165 #else // ABSL_HAVE_STD_OPTIONAL 176 #endif // ABSL_HAVE_STD_OPTIONAL 178 #if defined(ABSL_HAVE_STD_ANY) || defined(ABSL_HAVE_STD_VARIANT) 188 template <
typename T>
191 template <
typename T>
193 #endif // ABSL_HAVE_STD_ANY || ABSL_HAVE_STD_VARIANT 195 #ifdef ABSL_HAVE_STD_VARIANT 210 #endif // ABSL_HAVE_STD_VARIANT 218 template <
typename T>
227 template <
typename T>
230 return static_cast<T&&
>(t);
233 namespace utility_internal {
235 template <
typename Functor,
typename Tuple, std::size_t... Indexes>
238 absl::forward<Functor>(functor),
239 std::get<Indexes>(absl::forward<Tuple>(t))...)) {
241 absl::forward<Functor>(functor),
242 std::get<Indexes>(absl::forward<Tuple>(t))...);
286 template <
typename Functor,
typename Tuple>
287 auto apply(Functor&& functor, Tuple&& t)
289 absl::forward<Functor>(functor), absl::forward<Tuple>(t),
291 typename std::remove_reference<Tuple>::type>::
value>{})) {
293 absl::forward<Functor>(functor), absl::forward<Tuple>(t),
295 typename std::remove_reference<Tuple>::type>::
value>{});
311 template <
typename T,
typename U = T>
314 obj = absl::forward<U>(new_value);
320 #endif // ABSL_UTILITY_UTILITY_H_
constexpr T && forward(absl::remove_reference_t< T > &t) noexcept
InvokeT< F, Args... > Invoke(F &&f, Args &&...args)
typename std::remove_reference< T >::type remove_reference_t
auto apply_helper(Functor &&functor, Tuple &&t, index_sequence< Indexes... >) -> decltype(absl::base_internal::Invoke(absl::forward< Functor >(functor), std::get< Indexes >(absl::forward< Tuple >(t))...))
void in_place_type(utility_internal::InPlaceTypeTag< T >)
void(*)(utility_internal::InPlaceTypeTag< T >) in_place_type_t
make_integer_sequence< size_t, N > make_index_sequence
typename utility_internal::Gen< T, N >::type make_integer_sequence
static constexpr size_t size() noexcept
auto apply(Functor &&functor, Tuple &&t) -> decltype(utility_internal::apply_helper(absl::forward< Functor >(functor), absl::forward< Tuple >(t), absl::make_index_sequence< std::tuple_size< typename std::remove_reference< Tuple >::type >::value >
make_index_sequence< sizeof...(Ts)> index_sequence_for
void(*)(utility_internal::InPlaceIndexTag< I >) in_place_index_t
ABSL_INTERNAL_INLINE_CONSTEXPR(size_t, variant_npos,-1)
void in_place_index(utility_internal::InPlaceIndexTag< I >)
typename Extend< typename Gen< T, N/2 >::type, N/2, N%2 >::type type
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
T exchange(T &obj, U &&new_value)