Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Possible inconsistency with Rect::Contains() right-bottom bounds?
Possible inconsistency with Rect::Contains() right-bottom bounds? [message #53038] Sun, 16 February 2020 13:06 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 1094
Registered: August 2007
Senior Contributor
Hello,

I've noticed that:

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


 
Read Message
Read Message
Read Message
Previous Topic: Problem linking using RegExp
Next Topic: Vector& Vector::operator<<(T&& x) is missing
Goto Forum:
  


Current Time: Sun Jun 09 15:04:03 CEST 2024

Total time taken to generate the page: 0.01553 seconds