4#ifndef TETL_RANGES_SIZE_HPP
5#define TETL_RANGES_SIZE_HPP
7#include <etl/_array/c_array.hpp>
8#include <etl/_concepts/integral.hpp>
9#include <etl/_ranges/decay_copy.hpp>
10#include <etl/_ranges/disable_sized_range.hpp>
11#include <etl/_ranges/iterator_t.hpp>
12#include <etl/_type_traits/remove_cv.hpp>
18auto size(
auto&) ->
void =
delete;
19auto size(
auto const&) ->
void =
delete;
22concept has_member_size =
not etl::
ranges::disable_sized_range<
etl::remove_cv_t<T>>
and requires(T&& t) {
23 { decay_copy(t.size()) } ->
etl::integral;
28concept has_adl_size =
not has_member_size<T>
and not etl::
ranges::disable_sized_range<
etl::remove_cv_t<T>>
and requires(T&& t) {
29 { decay_copy(size(t)) } ->
etl::integral;
34 template <
typename T,
etl::size_t Size>
35 [[nodiscard]]
constexpr auto operator()(
etl::c_array<T, Size>& )
const noexcept
40 template <
typename T,
etl::size_t Size>
41 [[nodiscard]]
constexpr auto operator()(
etl::c_array<T, Size>&& )
const noexcept
46 template <has_member_size T>
47 [[nodiscard]]
constexpr auto operator()(T&& t)
const noexcept(
noexcept(decay_copy(t.size())))
49 return decay_copy(t.size());
52 template <has_adl_size T>
53 [[nodiscard]]
constexpr auto operator()(T&& t)
const noexcept(
noexcept(decay_copy(size(t))))
55 return decay_copy(size(t));
58 auto operator()(
auto&&)
const ->
void =
delete;
65inline constexpr auto size = size_cpo::fn{};
constexpr auto size
Definition size.hpp:65
Definition ranges_iter_move.hpp:61
Definition ranges_in_fun_result.hpp:12
Definition adjacent_find.hpp:9