1#ifndef SANISIZER_CLASS_HPP
2#define SANISIZER_CLASS_HPP
26template<
typename Value_>
35 constexpr Cast(Value_ x) : my_x(x) {}
41 template<
typename Output_>
42 constexpr operator Output_()
const {
56template<
typename Integer_>
58 static_assert(std::is_integral<Integer_>::value);
65 constexpr Exact(Integer_ x) : my_x(x) {}
70 constexpr operator Integer_()
const {
79 template<
typename Output_>
80 constexpr operator Output_()
const =
delete;
Create compile-time attestations.
Safe casts of integer size.
Cast an integer in a function call.
Definition class.hpp:27
constexpr Cast(Value_ x)
Definition class.hpp:35
Do not cast an integer in a function call.
Definition class.hpp:57
constexpr Exact(Integer_ x)
Definition class.hpp:65
Sanitize sizes to avoid integer overflow.
Definition arithmetic.hpp:16
constexpr Dest_ cast(Value_ x)
Definition cast.hpp:46