Removed explicit VectorI::operator[]
Since Vector instances can be implicitely converted to T*, native operator[] will work on them Former-commit-id: 3f4a1822c514886dee7d9e5dab816c80e5c5ee99
This commit is contained in:
@@ -233,40 +233,6 @@ NzVector4<T>::operator const T*() const
|
||||
return &x;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T& NzVector4<T>::operator[](unsigned int i)
|
||||
{
|
||||
#if NAZARA_MATH_SAFE
|
||||
if (i >= 4)
|
||||
{
|
||||
NzStringStream ss;
|
||||
ss << "Index out of range: (" << i << " >= 4)";
|
||||
|
||||
NazaraError(ss);
|
||||
throw std::domain_error(ss.ToString());
|
||||
}
|
||||
#endif
|
||||
|
||||
return *(&x+i);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T NzVector4<T>::operator[](unsigned int i) const
|
||||
{
|
||||
#if NAZARA_MATH_SAFE
|
||||
if (i >= 4)
|
||||
{
|
||||
NzStringStream ss;
|
||||
ss << "Index out of range: (" << i << " >= 4)";
|
||||
|
||||
NazaraError(ss);
|
||||
throw std::domain_error(ss.ToString());
|
||||
}
|
||||
#endif
|
||||
|
||||
return *(&x+i);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
const NzVector4<T>& NzVector4<T>::operator+() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user