Function operator-

Summary

#include <include/type_safe/index.hpp>

(1) constexpr index_t operator-(const index_t &lhs, const difference_t &rhs) noexcept

(2) constexpr difference_t operator-(const index_t &lhs, const index_t &rhs) noexcept

Function overload

Synopsis

#include <include/type_safe/index.hpp>

constexpr index_t operator-(const index_t &lhs, const difference_t &rhs) noexcept

Description

Returns
The given [ts::index_t]() advanced backwards by the given [ts::distance_t](). \module types

Source

Lines 126-129 in include/type_safe/index.hpp.

constexpr index_t operator-(const index_t& lhs, const difference_t& rhs) noexcept
{
    return index_t(make_unsigned(make_signed(get(lhs)) - get(rhs)));
}

Synopsis

#include <include/type_safe/index.hpp>

constexpr difference_t operator-(const index_t &lhs, const index_t &rhs) noexcept

Description

Returns
Returns the distance between two indices. This is the number of steps you need to increment lhs to reach rhs, it is negative if lhs > rhs. \module types

Source

Lines 135-138 in include/type_safe/index.hpp.

constexpr difference_t operator-(const index_t& lhs, const index_t& rhs) noexcept
{
    return difference_t(make_signed(get(lhs)) - make_signed(get(rhs)));
}





Add Discussion as Guest

Log in