Cleanup pass
This commit is contained in:
@@ -735,24 +735,15 @@ namespace Nz
|
||||
* \brief Returns the ith element of the box
|
||||
* \return A reference to the ith element of the box
|
||||
*
|
||||
* \remark Access to index greather than 6 is undefined behavior
|
||||
* \remark Produce a NazaraError if you try to acces to index greather than 6 with NAZARA_MATH_SAFE defined
|
||||
* \remark Access to index greater than 6 is undefined behavior
|
||||
* \remark Produce a NazaraError if you try to access to index greater than 6 with NAZARA_MATH_SAFE defined
|
||||
* \throw std::domain_error if NAZARA_MATH_SAFE is defined and one of you try to acces to index greather than 6
|
||||
*/
|
||||
|
||||
template<typename T>
|
||||
T& Box<T>::operator[](unsigned int i)
|
||||
T& Box<T>::operator[](std::size_t i)
|
||||
{
|
||||
#if NAZARA_MATH_SAFE
|
||||
if (i >= 6)
|
||||
{
|
||||
StringStream ss;
|
||||
ss << "Index out of range: (" << i << " >= 6)";
|
||||
|
||||
NazaraError(ss);
|
||||
throw std::domain_error(ss.ToString());
|
||||
}
|
||||
#endif
|
||||
NazaraAssert(i < 6, "Index out of range");
|
||||
|
||||
return *(&x+i);
|
||||
}
|
||||
@@ -761,24 +752,15 @@ namespace Nz
|
||||
* \brief Returns the ith element of the box
|
||||
* \return A value to the ith element of the box
|
||||
*
|
||||
* \remark Access to index greather than 6 is undefined behavior
|
||||
* \remark Produce a NazaraError if you try to acces to index greather than 6 with NAZARA_MATH_SAFE defined
|
||||
* \remark Access to index greater than 6 is undefined behavior
|
||||
* \remark Produce a NazaraError if you try to access to index greater than 6 with NAZARA_MATH_SAFE defined
|
||||
* \throw std::domain_error if NAZARA_MATH_SAFE is defined and one of you try to acces to index greather than 6
|
||||
*/
|
||||
|
||||
template<typename T>
|
||||
T Box<T>::operator[](unsigned int i) const
|
||||
T Box<T>::operator[](std::size_t i) const
|
||||
{
|
||||
#if NAZARA_MATH_SAFE
|
||||
if (i >= 6)
|
||||
{
|
||||
StringStream ss;
|
||||
ss << "Index out of range: (" << i << " >= 6)";
|
||||
|
||||
NazaraError(ss);
|
||||
throw std::domain_error(ss.ToString());
|
||||
}
|
||||
#endif
|
||||
NazaraAssert(i < 6, "Index out of range");
|
||||
|
||||
return *(&x+i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user