Function make_signed

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_signed_t< Integer > make_signed(const Integer &i)

(2) template <typename Integer, class Policy>
    constexpr TYPE_SAFE_FORCE_INLINE make_signed_t< integer< Integer, Policy > > make_signed(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_signed_t< Integer > make_signed(const Integer &i)

Description

Returns
A new integer of the corresponding signed integer type. \requires The value of i must fit into signed type. \module types
Parameters

1 - \exclude

Source

Lines 355-363 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_signed_t<Integer> make_signed(const Integer& i)
{
    using result_type = make_signed_t<Integer>;
    return i <= Integer(std::numeric_limits<result_type>::max())
               ? static_cast<result_type>(i)
               : DEBUG_UNREACHABLE(detail::precondition_error_handler{}, "conversion "
                                                                         "would "

Synopsis

#include <include/type_safe/integer.hpp>

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

Description

Returns
A new [ts::integer]() of the corresponding signed integer type. \requires The value of i must fit into signed type. \module types

Source

Lines 369-373 in include/type_safe/integer.hpp.

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





Add Discussion as Guest

Log in