1#ifndef SANISIZER_COMPARISONS_HPP
2#define SANISIZER_COMPARISONS_HPP
25template<
typename Left_,
typename Right_>
26constexpr bool is_equal(Left_ left, Right_ right) {
41template<
typename Left_,
typename Right_>
57template<
typename Left_,
typename Right_>
73template<
typename Left_,
typename Right_>
89template<
typename Left_,
typename Right_>
105template<
typename First_,
typename Second_>
106constexpr auto min(First_ first, Second_ second) {
109 const bool first_larger = as_unsigned(fval) > as_unsigned(sval);
115 return static_cast<I<decltype(sval)
> >(fval);
119 return static_cast<I<decltype(fval)
> >(sval);
137template<
typename First_,
typename Second_>
138constexpr auto max(First_ first, Second_ second) {
141 const bool first_larger = as_unsigned(fval) > as_unsigned(sval);
147 return static_cast<I<decltype(fval)
> >(sval);
151 return static_cast<I<decltype(sval)
> >(fval);
Create compile-time attestations.
Sanitize sizes to avoid integer overflow.
Definition arithmetic.hpp:16
constexpr bool is_greater_than(Left_ left, Right_ right)
Definition comparisons.hpp:74
constexpr auto get_value(Value_ x)
Definition attest.hpp:105
constexpr bool is_equal(Left_ left, Right_ right)
Definition comparisons.hpp:26
constexpr auto max(First_ first, Second_ second)
Definition comparisons.hpp:138
constexpr bool is_greater_than_or_equal(Left_ left, Right_ right)
Definition comparisons.hpp:90
constexpr auto get_max()
Definition attest.hpp:119
constexpr bool is_less_than_or_equal(Left_ left, Right_ right)
Definition comparisons.hpp:58
constexpr auto min(First_ first, Second_ second)
Definition comparisons.hpp:106
constexpr bool is_less_than(Left_ left, Right_ right)
Definition comparisons.hpp:42