Commit 81d567a6 authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

core: add template to_unsigned function

parent 75b4b1ab
......@@ -109,6 +109,14 @@ using u32 = uint32_t;
using u64 = uint64_t;
using sz = size_t;
template<typename Integer>
constexpr typename std::make_unsigned<Integer>::type
to_unsigned(Integer value)
{
irt_assert(value >= 0);
return static_cast<typename std::make_unsigned<Integer>::type>(value);
}
/*****************************************************************************
*
* Return status of many function
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment