Function make_unsigned

Summary

#include <include/type_safe/integer.hpp>

(1) template <typename Integer, typename = typename std::enable_if<detail::is_integer<Integer>::value>::type>
    constexpr TYPE_SAFE_FORCE_INLINE make_unsigned_t< Integer > make_unsigned(const Integer &i)

(2) template <typename Integer, class Policy>
    constexpr TYPE_SAFE_FORCE_INLINE make_unsigned_t< integer< Integer, Policy > > make_unsigned(const integer< Integer, Policy > &i)

Function overload

Synopsis

#include <include/type_safe/integer.hpp>

template <typename Integer, typename = typename std::enable_if<detail::is_integer<Integer>::value>::type>
constexpr TYPE_SAFE_FORCE_INLINE make_unsigned_t< Integer > make_unsigned(const Integer &i)

Description

Returns
A new integer of the corresponding unsigned integer type. \requires The value of i must not be negative. \module types
Parameters

1 - \exclude

Source

Lines 388-394 in include/type_safe/integer.hpp.

template <typename Integer,
          typename = typename std::enable_if<detail::is_integer<Integer>::value>::type>
TYPE_SAFE_FORCE_INLINE constexpr make_unsigned_t<Integer> make_unsigned(const Integer& i)
{
    using result_type = make_unsigned_t<Integer>;
    return i >= Integer(0) ? static_cast<result_type>(i)
                           : DEBUG_UNREACHABLE(detail::precondition_error_handler{},

Synopsis

#include <include/type_safe/integer.hpp>

template <typename Integer, class Policy>
constexpr TYPE_SAFE_FORCE_INLINE make_unsigned_t< integer< Integer, Policy > > make_unsigned(const integer< Integer, Policy > &i)

Description

Returns
A new [ts::integer]() of the corresponding unsigned integer type. \requires The value of i must not be negative. \module types

Source

Lines 400-404 in include/type_safe/integer.hpp.

/// \module types
template <typename Integer, class Policy>
TYPE_SAFE_FORCE_INLINE constexpr make_unsigned_t<integer<Integer, Policy>> make_unsigned(
    const integer<Integer, Policy>& i)
{





Add Discussion as Guest

Log in