Cleanup pass

This commit is contained in:
Lynix
2017-04-22 15:08:05 +02:00
parent ec310b9577
commit 06038a4d81
25 changed files with 124 additions and 206 deletions

View File

@@ -578,23 +578,14 @@ namespace Nz
* \return A reference to the ith element of the rectangle
*
* \remark Access to index greather than 4 is undefined behavior
* \remark Produce a NazaraError if you try to acces to index greather than 4 with NAZARA_MATH_SAFE defined
* \remark Produce a NazaraError if you try to access to index greater than 4 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 4
*/
template<typename T>
T& Rect<T>::operator[](unsigned int i)
T& Rect<T>::operator[](std::size_t i)
{
#if NAZARA_MATH_SAFE
if (i >= 4)
{
StringStream ss;
ss << "Index out of range: (" << i << " >= 4)";
NazaraError(ss);
throw std::domain_error(ss.ToString());
}
#endif
NazaraAssert(i < 4, "Index out of range");
return *(&x+i);
}
@@ -603,24 +594,15 @@ namespace Nz
* \brief Returns the ith element of the rectangle
* \return A value to the ith element of the rectangle
*
* \remark Access to index greather than 4 is undefined behavior
* \remark Produce a NazaraError if you try to acces to index greather than 4 with NAZARA_MATH_SAFE defined
* \remark Access to index greater than 4 is undefined behavior
* \remark Produce a NazaraError if you try to access to index greater than 4 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 4
*/
template<typename T>
T Rect<T>::operator[](unsigned int i) const
T Rect<T>::operator[](std::size_t i) const
{
#if NAZARA_MATH_SAFE
if (i >= 4)
{
StringStream ss;
ss << "Index out of range: (" << i << " >= 4)";
NazaraError(ss);
throw std::domain_error(ss.ToString());
}
#endif
NazaraAssert(i < 4, "Index out of range");
return *(&x+i);
}