In my code I pretty often use rects and calculate their corners, this is why I use a subclass of Rect<T> class to get following behaviour:
template <typename T>
sf::Vector2<T> Rect<T>::GetP1() const
{
return Vector2<T>(Left, Top);
}
template <typename T>
sf::Vector2<T> Rect<T>::GetP2() const
{
return Vector2<T>(Right, Bottom);
}
I believe it could be useful to add it to SFML. It makes code like
Rectangle(rect.left, rect.top, rect.right, rect.bottom, ...);
// or
Rectangle(Vector2f(rect.left, rect.top), Vector2f(rect.right, rect.bottom), ...);
a little shorter:
Rectangle(rect.GetP1(), rect.GetP2(), ...);