4#ifndef TETL_RANGES_BEGIN_HPP
5#define TETL_RANGES_BEGIN_HPP
7#include <etl/_iterator/input_or_output_iterator.hpp>
8#include <etl/_ranges/can_borrow.hpp>
9#include <etl/_ranges/decay_copy.hpp>
15auto begin(
auto&) ->
void =
delete;
16auto begin(
auto const&) ->
void =
delete;
19concept has_member_begin =
ranges::detail::can_borrow<T>
and requires(T&& t) {
20 { decay_copy(t.begin()) } -> input_or_output_iterator;
24concept has_adl_begin =
not has_member_begin<T>
and ranges::detail::can_borrow<T>
and requires(T&& t) {
25 { decay_copy(begin(t)) } -> input_or_output_iterator;
30 requires(
sizeof(T) >= 0)
31 [[nodiscard]]
constexpr auto operator()(T (&t)[])
const noexcept
36 template <
typename T,
etl::size_t Size>
37 requires(
sizeof(T) >= 0)
38 [[nodiscard]]
constexpr auto operator()(T (&t)[Size])
const noexcept
43 template <has_member_begin T>
44 [[nodiscard]]
constexpr auto operator()(T&& t)
const noexcept(
noexcept(decay_copy(t.begin())))
46 return decay_copy(t.begin());
49 template <has_adl_begin T>
50 [[nodiscard]]
constexpr auto operator()(T&& t)
const noexcept(
noexcept(decay_copy(begin(t))))
52 return decay_copy(begin(t));
55 auto operator()(
auto&&)
const ->
void =
delete;
62inline constexpr auto begin = begin_cpo::fn{};
constexpr auto begin
Definition begin.hpp:62
Definition ranges_iter_move.hpp:61
Definition ranges_in_fun_result.hpp:12
Definition adjacent_find.hpp:9