5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INTEGER_SEQUENCES_MAKE_INTEGER_SEQUENCE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INTEGER_SEQUENCES_MAKE_INTEGER_SEQUENCE_HPP_
8#include "arene/base/stdlib_choice/cstddef.hpp"
9#include "arene/base/stdlib_choice/integer_sequence.hpp"
10#include "arene/base/stdlib_choice/numeric_limits.hpp"
15namespace make_integer_sequence_detail {
23template <
typename Type, Type Begin, std::size_t... Is>
24auto impl(std::index_sequence<Is...>) -> std::integer_sequence<Type, (Begin + Type{Is})...>;
31template <
typename Type, Type Begin, Type Size,
bool = (Size > Type{})>
32extern constexpr bool is_valid_range_v{Size == Type{}};
38template <
typename Type, Type Begin, Type Size>
39extern constexpr bool is_valid_range_v<Type, Begin, Size,
true>{
40 Begin <= (std::numeric_limits<Type>::max() - (Size - 1))
47template <
typename Type, Type Begin, Type Size,
bool = is_valid_range_v<Type, Begin, Size>>
48struct make_from_impl {
49 static_assert(Size >= Type{},
"Size must be non-negative");
52 static constexpr auto max = std::numeric_limits<Type>::max();
55 (Size == 0) || (Begin <= (max - (Size - 1))),
56 "Sequence with the given Begin and Size would overflow the representable range of Type"
60 using type =
decltype(make_integer_sequence_detail::impl<Type, Begin>(std::make_index_sequence<Size>{}));
67template <
typename Type, Type Begin, Type Size>
68struct make_from_impl<Type, Begin, Size,
false> {
69 static_assert(Size >= Type{},
"Size must be non-negative");
72 static constexpr auto max = std::numeric_limits<Type>::max();
75 (Size == 0) || (Begin <= (max - (Size - 1))),
76 "Sequence with the given Begin and Size would overflow the representable range of Type"
91namespace make_integer_sequence_detail {
97template <
typename Type, Type Begin, Type End,
bool = Begin <= End>
98struct make_between_impl {
100 using type = make_integer_sequence_from<Type, Begin, Type{End - Begin}>;
107template <
typename Type, Type Begin, Type End>
108struct make_between_impl<Type, Begin, End,
false> {
109 static_assert(Begin <= End,
"Precondition Begin <= End not satisfied");
Definition array_exceptions_disabled.cpp:11
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10