26 #include <boost/operators.hpp>
42 private boost::equality_comparable<Vec2>,
43 private boost::additive<Vec2>,
44 private boost::additive<Vec2, Real>,
45 private boost::multiplicative<Vec2, Real>
64 explicit Vec2(
const float v[2]): x(v[0]), y(v[1]) { }
68 explicit Vec2(
const double v[2]): x(v[0]), y(v[1]) { }
80 return x==rhs.
x && y==rhs.
y;
84 Real& operator[](std::size_t indx)
87 throw std::out_of_range(
"Index must be in the range [0-1]");
93 const Real& operator[](std::size_t indx)
const
96 throw std::out_of_range(
"Index must be in the range [0-1]");
162 return Vec2(d/v.
x, d/v.
y);
167 os <<
"(" << v[0] <<
"," << v[1] <<
")";