Added explicit conversions between different types of sf::Vector2, sf::Vector3 and sf::Rect (implements feature #31)

This commit is contained in:
Laurent Gomila 2011-04-26 19:20:24 +02:00
parent ade8cb8771
commit eac841ec71
6 changed files with 75 additions and 0 deletions

View file

@ -56,6 +56,20 @@ public :
////////////////////////////////////////////////////////////
Vector3(T X, T Y, T Z);
////////////////////////////////////////////////////////////
/// \brief Construct the vector from another type of vector
///
/// This constructor doesn't replace the copy constructor,
/// it's called only when U != T.
/// A call to this constructor will fail to compile if U
/// is not convertible to T.
///
/// \param vector Vector to convert
///
////////////////////////////////////////////////////////////
template <typename U>
explicit Vector3(const Vector3<U>& vector);
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////