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 index_t operator+(const difference_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 by the given [ts::distance_t](). \module types \group index_distance_plus

Source

Lines 113-116 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 index_t operator+(const difference_t &lhs, const index_t &rhs) noexcept

Description

\group index_distance_plus

Source

Lines 119-122 in include/type_safe/index.hpp.

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





Add Discussion as Guest

Log in