File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -662,12 +662,23 @@ struct point_type
662
662
return std::make_tuple (std::ref (m_x), std::ref (m_y), std::ref (m_z));
663
663
}
664
664
665
- // / \brief Compare with @a rhs
665
+ #if defined(__cpp_impl_three_way_comparison)
666
+ // / \brief a default spaceship operator
667
+ constexpr auto operator <=>(const point_type &rhs) const = default ;
668
+ #else
669
+ // / \brief a default equals operator
666
670
constexpr bool operator ==(const point_type &rhs) const
667
671
{
668
672
return m_x == rhs.m_x and m_y == rhs.m_y and m_z == rhs.m_z ;
669
673
}
670
674
675
+ // / \brief a default not-equals operator
676
+ constexpr bool operator !=(const point_type &rhs) const
677
+ {
678
+ return not operator ==(rhs);
679
+ }
680
+ #endif
681
+
671
682
// consider point as a vector... perhaps I should rename point?
672
683
673
684
// / \brief looking at the point as if it is a vector, return the squared length
You can’t perform that action at this time.
0 commit comments