Function distance

Synopsis

#include <include/type_safe/index.hpp>

constexpr difference_t distance(const index_t &a, const index_t &b)

Description

Returns
The distance between two [ts::index_t]() objects, i.e. how often you'd have to increment a to reach b. \notes This is the same as b - a and the equivalent of [std::distance()](). \module types

Mentioned in

Source

Lines 205-208 in include/type_safe/index.hpp.

constexpr difference_t distance(const index_t& a, const index_t& b)
{
    return b - a;
}





Add Discussion as Guest

Log in