5 #ifndef _SPICA_POINT2D_H_
6 #define _SPICA_POINT2D_H_
17 Point2_(
const Point2_<T>& p);
19 Point2_<T>& operator=(
const Point2_<T>& p);
20 Point2_<T> operator-()
const;
21 Point2_<T>& operator+=(
const Point2_<T>& p);
22 Point2_<T>& operator-=(
const Point2_<T>& p);
23 Point2_<T>& operator*=(T s);
24 T operator[](
int i)
const;
26 inline T x()
const {
return x_; }
27 inline T y()
const {
return y_; }
29 std::string toString()
const;
34 static_assert(std::is_arithmetic<T>::value,
35 "Template type must be arithmetic!!");
39 using Point2i = Point2_<int>;
40 using Point2f = Point2_<float>;
41 using Point2d = Point2_<double>;
46 std::ostream& operator<<(std::ostream& os, const spica::Point2_<T>& p);
61 #include "point2d_detail.h"
63 #endif // _SPICA_POINT2D_H_