1#ifndef SANISIZER_CLASS_HPP
2#define SANISIZER_CLASS_HPP
25template<
typename Value_>
33 constexpr Cast(Value_ x) : my_x(x) {}
39 template<
typename Output_>
40 constexpr operator Output_()
const {
54template<
typename Integer_>
56 static_assert(std::is_integral<Integer_>::value);
63 constexpr Exact(Integer_ x) : my_x(x) {}
68 constexpr operator Integer_()
const {
77 template<
typename Output_>
78 constexpr operator Output_()
const =
delete;
Safe casts of integer size.
Cast an integer in a function call.
Definition class.hpp:26
constexpr Cast(Value_ x)
Definition class.hpp:33
Do not cast an integer in a function call.
Definition class.hpp:55
constexpr Exact(Integer_ x)
Definition class.hpp:63
Generics for operating on integer representations.
Sanitize sizes to avoid integer overflow.
Definition Bounded.hpp:15
constexpr Dest_ cast(Value_ x)
Definition cast.hpp:59