You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

14 lines
420 B

#pragma once
#include "detail/cast_to_unsigned_integer.hpp"
// cast a signed integer with range [-x, x) to range [0, 2x)
struct cast_to_unsigned_integer_fn {
template <typename I, std::enable_if_t<std::is_integral_v<I>>>
constexpr auto operator()(I n) const
{
return detail::cast_to_unsigned_integer_impl(n);
}
};
static constexpr auto cast_to_unsigned_integer = cast_to_unsigned_integer_fn{};