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_
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 = constra
ints<>>
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>
40extern constexpr bool is_addable_v = arithmetic_traits_detail::is_addable_v<Lhs, Rhs>;
42namespace arithmetic_traits_detail {
47template <
typename Lhs,
typename Rhs,
typename = constra
ints<>>
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>>>> =
64template <
typename Lhs,
typename Rhs = Lhs>
65extern constexpr bool is_nothrow_addable_v = arithmetic_traits_detail::is_nothrow_addable_v<Lhs, Rhs>;
67namespace arithmetic_traits_detail {
72template <
typename Lhs,
typename Rhs,
typename = constra
ints<>>
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>
90extern constexpr bool is_subtractable_v = arithmetic_traits_detail::is_subtractable_v<Lhs, Rhs>;
92namespace arithmetic_traits_detail {
97template <
typename Lhs,
typename Rhs,
typename = constra
ints<>>
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>>>> =
114template <
typename Lhs,
typename Rhs = Lhs>
Definition accumulate.hpp:37
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...
Definition accumulate.hpp:36
auto declval() noexcept -> T &&
A dummy function that is declared but not defined, with a user-specified return type,...