Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
disable_sized_range.hpp
Go to the documentation of this file.
1// Copyright 2026, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_RANGES_DISABLE_SIZED_RANGE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_RANGES_DISABLE_SIZED_RANGE_HPP_
7
8// IWYU pragma: private, include "arene/base/ranges.hpp"
9// IWYU pragma: friend "(arene/base(?!/tests)|stdlib/include/stdlib_detail)/.*"
10
11// parasoft-begin-suppress AUTOSAR-A16_2_2-a-2 "Arene Base aggregate headers permitted by A16-2-2 Permit #1"
12#include "arene/base/stdlib_choice/integral_constant.hpp"
13// parasoft-end-suppress AUTOSAR-A16_2_2-a-2 "Arene Base aggregate headers permitted by A16-2-2 Permit #1"
14
15namespace arene {
16namespace base {
17namespace ranges {
18
19/// @brief An opt-out trait to indicate that a range type's member/ADL @c size() is not a constant-time operation.
20///
21/// @tparam Rng The range type to check.
22///
23/// Users should specialize this trait for their range types to derive from @c std::true_type when the type's member or
24/// ADL @c size() cannot be assumed to run in constant time. The primary template derives from @c std::false_type .
25///
26/// When the trait is @c true , @c arene::base::ranges::size ignores any member and ADL @c size() . It may still obtain
27/// the size from <c>end() - begin()</c> when the iterator/sentinel pair models a sized sentinel, as that subtraction is
28/// assumed to be a constant-time operation.
29template <typename Rng>
31
32/// @brief Accessor for the value of @c disable_sized_range .
33/// @tparam Rng The range type to check.
34/// @return Equivalent to @c disable_sized_range<Rng>::value .
35template <typename Rng>
37
38} // namespace ranges
39} // namespace base
40} // namespace arene
41
42#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_RANGES_DISABLE_SIZED_RANGE_HPP_
An opt-out trait to indicate that a range type's member/ADL size() is not a constant-time operation.
Definition disable_sized_range.hpp:30
static constexpr value_type value
Definition integral_constant.hpp:34
Definition external_vector.hpp:803
constexpr bool disable_sized_range_v
Accessor for the value of disable_sized_range .
Definition accumulate.hpp:37
Definition accumulate.hpp:36
bool_constant< false > false_type
An alias for bool_constant<false>
Definition integral_constant.hpp:79