Exemple #1
0
inline constexpr
typename SIDIM_STD::common_type<TDistance1, TDistance2>::type
operator-(const position<TTag, TDistance1>& x,
          const position<TTag, TDistance2>& y)
{
    return x.distance_from_origin() - y.distance_from_origin();
}
Exemple #2
0
inline constexpr
bool
operator>=(const position<TTag, TDistance1>& x,
           const position<TTag, TDistance2>& y)
{
    return x.distance_from_origin() >= y.distance_from_origin();
}
Exemple #3
0
inline constexpr
position<TTag, TToDistance>
position_cast(const position<TTag, TFromDistance>& pos)
{
    return position<TTag, TToDistance>(distance_cast<TToDistance>(
                            pos.distance_from_origin()));
}
Exemple #4
0
inline constexpr
position<TTag,
         typename SIDIM_STD::common_type<TDistance1, distance<TRep2, TInterval2> >::type>
operator-(const position<TTag, TDistance1>& pos,
          const distance<TRep2, TInterval2>& d)
{
    using common_distance = typename SIDIM_STD::common_type<
                                TDistance1, distance<TRep2, TInterval2> >::type;

    return position<TTag, common_distance>(pos.distance_from_origin() - d);
}
Exemple #5
0
 constexpr
 position(const position<tag, TDistance2>& pos)
     : m_distance(pos.distance_from_origin())
 {
 }