19 #ifndef MIR_GEOMETRY_POINT_GENERIC_H_
20 #define MIR_GEOMETRY_POINT_GENERIC_H_
35 template<
template<
typename>
typename T>
37 template<
template<
typename>
typename T>
40 template<
template<
typename>
typename T>
43 template<
typename Tag>
53 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
54 explicit constexpr
Point(P
const& other) noexcept
55 :
x{T<XTag>{other.x}},
60 template<
typename XType,
typename YType>
67 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
68 inline constexpr
bool operator == (P
const& lhs, P
const& rhs)
70 return lhs.x == rhs.x && lhs.y == rhs.y;
73 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
74 inline constexpr
bool operator != (P
const& lhs, P
const& rhs)
76 return lhs.x != rhs.x || lhs.y != rhs.y;
79 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
81 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
84 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
86 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
89 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
91 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
94 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
96 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
99 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
102 out << value.x <<
", " << value.y;
constexpr D operator-(D const &lhs, D const &rhs)
Definition: displacement_generic.h:96
std::ostream & operator<<(std::ostream &out, W const &value)
Definition: dimensions_generic.h:144
typename GeometricType::template Corresponding< Tag > Corresponding
Definition: dimensions_generic.h:141
constexpr bool operator!=(D const &lhs, D const &rhs)
Definition: displacement_generic.h:77
constexpr D::PointType & operator-=(typename D::PointType &lhs, D const &rhs)
Definition: displacement_generic.h:138
constexpr D operator+(D const &lhs, D const &rhs)
Definition: displacement_generic.h:90
constexpr bool operator==(D const &lhs, D const &rhs)
Definition: displacement_generic.h:71
constexpr D::PointType & operator+=(typename D::PointType &lhs, D const &rhs)
Definition: displacement_generic.h:132
Definition: splash_session.h:24
Definition: displacement.h:32
Used for determining if a type is a point.
Definition: point_generic.h:31
Definition: displacement_generic.h:45
Definition: point_generic.h:42
T< XTag > x
Definition: point_generic.h:63
Point & operator=(Point const &)=default
T< Tag > Corresponding
Definition: point_generic.h:44
T< YTag > y
Definition: point_generic.h:64
constexpr Point(P const &other) noexcept
Definition: point_generic.h:54
constexpr Point()=default
constexpr Point(Point const &)=default
constexpr Point(XType &&x, YType &&y)
Definition: point_generic.h:61
Definition: size_generic.h:43