5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_ARITHMETIC_TRAITS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_ARITHMETIC_TRAITS_HPP_
11#include "arene/base/constraints/constraints.hpp"
12#include "arene/base/stdlib_choice/declval.hpp"
13#include "arene/base/stdlib_choice/enable_if.hpp"
18namespace arithmetic_traits_detail {
23template <
typename Lhs,
typename Rhs,
typename = constraints<>>
24extern constexpr bool is_addable_v =
false;
30template <
typename Lhs,
typename Rhs>
31extern constexpr bool is_addable_v<Lhs, Rhs, constraints<
decltype(std::declval<Lhs>() + std::declval<Rhs>())>> =
true;
39template <
typename Lhs,
typename Rhs =
Lhs>
42namespace arithmetic_traits_detail {
47template <
typename Lhs,
typename Rhs,
typename = constraints<>>
48extern constexpr bool is_nothrow_addable_v =
false;
54template <
typename Lhs,
typename Rhs>
55extern constexpr bool is_nothrow_addable_v<Lhs, Rhs, constraints<std::enable_if_t<is_addable_v<Lhs, Rhs>>>> =
56 noexcept(std::declval<Lhs>() + std::declval<Rhs>());
64template <
typename Lhs,
typename Rhs =
Lhs>
67namespace arithmetic_traits_detail {
72template <
typename Lhs,
typename Rhs,
typename = constraints<>>
73extern constexpr bool is_subtractable_v =
false;
79template <
typename Lhs,
typename Rhs>
80extern constexpr bool is_subtractable_v<Lhs, Rhs, constraints<
decltype(std::declval<Lhs>() - std::declval<Rhs>())>> =
89template <
typename Lhs,
typename Rhs =
Lhs>
92namespace arithmetic_traits_detail {
97template <
typename Lhs,
typename Rhs,
typename = constraints<>>
98extern constexpr bool is_nothrow_subtractable_v =
false;
104template <
typename Lhs,
typename Rhs>
105extern constexpr bool is_nothrow_subtractable_v<Lhs, Rhs, constraints<std::enable_if_t<is_subtractable_v<Lhs, Rhs>>>> =
106 noexcept(std::declval<Lhs>() - std::declval<Rhs>());
114template <
typename Lhs,
typename Rhs =
Lhs>
Definition array_exceptions_disabled.cpp:11
constexpr bool is_addable_v
Check if instances of Lhs can be added to instances of Rhs. The value is true if they can be added,...
constexpr bool is_nothrow_addable_v
Check if instances of Lhs can be added to instances of Rhs without throwing an exception....
constexpr bool is_nothrow_subtractable_v
Check if instances of Rhs can be subtracted from an instance of Lhs without throwing an exception....
constexpr bool is_subtractable_v
Check if instances of Rhs can be subtracted from an instance of Lhs. The value is true if they can be...
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10