17 #ifndef MIR_GEOMETRY_POINT_GENERIC_H_
18 #define MIR_GEOMETRY_POINT_GENERIC_H_
33 template<
template<
typename>
typename T>
35 template<
template<
typename>
typename T>
38 template<
template<
typename>
typename T>
41 template<
typename Tag>
51 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
52 explicit constexpr
Point(P
const& other) noexcept
53 :
x{T<XTag>{other.x}},
58 template<
typename XType,
typename YType>
65 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
66 inline constexpr
bool operator == (P
const& lhs, P
const& rhs)
68 return lhs.x == rhs.x && lhs.y == rhs.y;
71 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
72 inline constexpr
bool operator != (P
const& lhs, P
const& rhs)
74 return lhs.x != rhs.x || lhs.y != rhs.y;
77 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
79 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
82 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>
87 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>
92 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>
97 template<typename P, typename std::enable_if<std::is_base_of<detail::PointBase, P>::value,
bool>::type =
true>
98 std::ostream&
operator<<(std::ostream& out, P
const& value)
100 out << value.x <<
", " << value.y;
constexpr D operator-(D const &lhs, D const &rhs)
Definition: displacement_generic.h:94
std::ostream & operator<<(std::ostream &out, W const &value)
Definition: dimensions_generic.h:142
typename GeometricType::template Corresponding< Tag > Corresponding
Definition: dimensions_generic.h:139
constexpr bool operator!=(D const &lhs, D const &rhs)
Definition: displacement_generic.h:75
constexpr D::PointType & operator-=(typename D::PointType &lhs, D const &rhs)
Definition: displacement_generic.h:136
constexpr D operator+(D const &lhs, D const &rhs)
Definition: displacement_generic.h:88
constexpr bool operator==(D const &lhs, D const &rhs)
Definition: displacement_generic.h:69
constexpr D::PointType & operator+=(typename D::PointType &lhs, D const &rhs)
Definition: displacement_generic.h:130
Definition: splash_session.h:22
Definition: displacement.h:30
Used for determining if a type is a point.
Definition: point_generic.h:29
Definition: displacement_generic.h:43
Definition: point_generic.h:40
T< XTag > x
Definition: point_generic.h:61
Point & operator=(Point const &)=default
T< Tag > Corresponding
Definition: point_generic.h:42
T< YTag > y
Definition: point_generic.h:62
constexpr Point(P const &other) noexcept
Definition: point_generic.h:52
constexpr Point()=default
constexpr Point(Point const &)=default
constexpr Point(XType &&x, YType &&y)
Definition: point_generic.h:59
Definition: size_generic.h:41