5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TUPLE_FOR_EACH_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TUPLE_FOR_EACH_HPP_
15#include "arene/base/stdlib_choice/cstddef.hpp"
16#include "arene/base/stdlib_choice/enable_if.hpp"
17#include "arene/base/stdlib_choice/forward.hpp"
18#include "arene/base/stdlib_choice/integer_sequence.hpp"
19#include "arene/base/stdlib_choice/integral_constant.hpp"
20#include "arene/base/stdlib_choice/remove_reference.hpp"
21#include "arene/base/stdlib_choice/tuple_size.hpp"
22#include "arene/base/tuple/detail/get.hpp"
32namespace tuple_for_each_detail {
43constexpr auto invoke_for_consume(F&& func, ArgTypes&&... args)
noexcept(
is_nothrow_invocable_v<F, ArgTypes...>)
58template <
typename Tuple,
typename Op,
std::size_t... I>
75template <
typename Tuple,
typename Op,
std::size_t... I>
79 std::integral_constant<std::size_t, I>{},
107template <
typename Tuple,
typename Op>
108constexpr void for_each(Tuple&& tuple, Op&& operation) {
109 tuple_for_each_detail::for_each(
142template <
typename Tuple,
typename Op>
144 tuple_for_each_detail::for_each_index(
obtain the number of elements in a tuple-like type
Definition tuple_size.hpp:22
Definition accumulate.hpp:37
constexpr bool is_invocable_v
Determine if a functor type is invocable with the specified argument types.
constexpr void consume_values(std::initializer_list< consume_values_detail::anything > const &) noexcept
Consume a list of values and discard them. Must be called with an extra pair of braces around the exp...
Definition consume_values.hpp:73
constexpr void for_each_index(Tuple &&tuple, Op &&operation)
Perform an operation on each element of a "tuple-ish" type, which includes std::tuple,...
Definition for_each.hpp:143
constexpr auto invoke(F &&func, Args &&... args) noexcept(is_nothrow_invocable_v< F, Args... >) ->
Implementation of std::invoke from C++23: invokes the specified callable with the specified arguments...
Definition invoke.hpp:281
constexpr void for_each(Tuple &&tuple, Op &&operation)
Perform an operation on each element of a "tuple-ish" type, which includes std::tuple,...
Definition for_each.hpp:108
constexpr bool is_nothrow_invocable_v
Determine if a functor type is no-throw invocable with the specified argument types.
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
Definition accumulate.hpp:36
make_integer_sequence< size_t, Size > make_index_sequence
A helper alias template for make_integer_sequence<size_t, Size>
Definition integer_sequence.hpp:224
integer_sequence< size_t, Ints... > index_sequence
A helper alias template for integer_sequence<size_t, Ints>
Definition integer_sequence.hpp:218
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41
typename remove_reference< T >::type remove_reference_t
An alias for T, but with top-level reference qualifiers removed.
Definition remove_reference.hpp:47
constexpr auto forward(remove_reference_t< T > &value) noexcept -> T &&
Cast a value to an rvalue if T is an rvalue or rvalue reference, otherwise forward an lvalue referenc...
Definition forward.hpp:24