From ed4e73f0d90faa50457b18cfa4c1264dcaed2658 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Tue, 11 Feb 2014 23:38:22 +0100 Subject: [PATCH] Fix in Vector conversion. No need for a conversion overload. Conversion constructor should cast whatever it's assigning. --- src/texture.cpp | 2 +- src/vector.hpp | 3 --- src/vector.inl | 14 +------------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/texture.cpp b/src/texture.cpp index 776ed88..164ebda 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -45,7 +45,7 @@ namespace cloonel { if (m_texture) { int width, height; SDL_QueryTexture(m_texture, nullptr, nullptr, &width, &height); - m_size = int2(width, height); + m_size = static_cast(int2(width, height)); } } diff --git a/src/vector.hpp b/src/vector.hpp index 4de6da3..87ae4f8 100644 --- a/src/vector.hpp +++ b/src/vector.hpp @@ -41,9 +41,6 @@ namespace cloonel { template const Vector& operator*= ( U parOther ); template const Vector& operator/= ( U parOther ); - template - operator Vector ( void ); - T& operator[] ( uint32_t parIndex ) { return m_mem[parIndex]; } const T& operator[] ( uint32_t parIndex ) const { return m_mem[parIndex]; } diff --git a/src/vector.inl b/src/vector.inl index 8cd3c39..a6b010e 100644 --- a/src/vector.inl +++ b/src/vector.inl @@ -13,7 +13,7 @@ namespace cloonel { template Vector::Vector (const Vector& parOther) { for (uint32_t z = 0; z < S; ++z) { - m_mem[z] = parOther.m_mem[z]; + m_mem[z] = static_cast(parOther.m_mem[z]); } } @@ -87,18 +87,6 @@ namespace cloonel { return *this; } - ///------------------------------------------------------------------------- - ///------------------------------------------------------------------------- - template - template - Vector::operator Vector() { - Vector retVal; - for (uint32_t z = 0; z < S; ++z) { - retVal[z] = m_mem[z]; - } - return retVal; - } - ///------------------------------------------------------------------------- ///------------------------------------------------------------------------- template