template <class T>
bool Rect_<T>::Contains(T x, T y) const {
return x >= left && x < right && y >= top && y < bottom;
} --- ---
x x
template <>
inline bool Rect_<double>::Contains(double x, double y) const {
return x >= left && x <= right && y >= top && y <= bottom;
} --- ---
^ ^
template <class T>
bool Rect_<T>::Contains(const Rect_<T>& r) const {
return r.left >= left && r.top >= top && r.right <= right && r.bottom <= bottom;
} --- ---
^ ^
template <class T>
bool Rect_<T>::Contains(T x, T y) const {
return x >= left && x < right && y >= top && y < bottom;
} --- ---
x x
template <>
inline bool Rect_<double>::Contains(double x, double y) const {
return x >= left && x <= right && y >= top && y <= bottom;
} --- ---
^ ^
template <class T>
bool Rect_<T>::Contains(const Rect_<T>& r) const {
return r.left >= left && r.top >= top && r.right <= right && r.bottom <= bottom;
} --- ---
^ ^
Best regards,
Obiivion
Thats intentional. It might be inconsistent, but for doubles it is better to include bottom-right corner into the rectangle.