Browse Source

Math: be reasonable, <utility> is not needed for std::declval.

Despite what the standard tries to say. I bet a large portion of
<type_traits> is impossible to implement without it, which is why all
STL implementations define it there already.
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
5e097681cb
  1. 4
      src/Magnum/Math/Algorithms/KahanSum.h
  2. 4
      src/Magnum/Math/Bezier.h
  3. 2
      src/Magnum/Math/BitVector.h
  4. 4
      src/Magnum/Math/Color.h
  5. 3
      src/Magnum/Math/Complex.h
  6. 3
      src/Magnum/Math/Dual.h
  7. 4
      src/Magnum/Math/DualComplex.h
  8. 3
      src/Magnum/Math/DualQuaternion.h
  9. 3
      src/Magnum/Math/Frustum.h
  10. 3
      src/Magnum/Math/FunctionsBatch.h
  11. 4
      src/Magnum/Math/Matrix.h
  12. 4
      src/Magnum/Math/Matrix3.h
  13. 4
      src/Magnum/Math/Matrix4.h
  14. 3
      src/Magnum/Math/Quaternion.h
  15. 4
      src/Magnum/Math/Range.h
  16. 4
      src/Magnum/Math/RectangularMatrix.h
  17. 3
      src/Magnum/Math/Vector.h
  18. 4
      src/Magnum/Math/Vector2.h
  19. 4
      src/Magnum/Math/Vector3.h
  20. 4
      src/Magnum/Math/Vector4.h

4
src/Magnum/Math/Algorithms/KahanSum.h

@ -29,7 +29,9 @@
* @brief Function @ref Magnum::Math::Algorithms::kahanSum()
*/
#include <utility> /* std::declval :( */
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
namespace Magnum { namespace Math { namespace Algorithms {

4
src/Magnum/Math/Bezier.h

@ -30,6 +30,10 @@
* @brief Class @ref Magnum::Math::Bezier, alias @ref Magnum::Math::QuadraticBezier, @ref Magnum::Math::QuadraticBezier2D, @ref Magnum::Math::QuadraticBezier3D, @ref Magnum::Math::CubicBezier, @ref Magnum::Math::CubicBezier2D, @ref Magnum::Math::CubicBezier3D
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/Vector.h"
#ifdef MAGNUM_BUILD_DEPRECATED

2
src/Magnum/Math/BitVector.h

@ -30,6 +30,8 @@
* @m_since_latest
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include <Corrade/Containers/sequenceHelpers.h>
#ifndef CORRADE_SINGLES_NO_DEBUG

4
src/Magnum/Math/Color.h

@ -29,6 +29,10 @@
* @brief Class @ref Magnum::Math::Color3, @ref Magnum::Math::Color4, literal @link Magnum::Math::Literals::operator""_rgb() @endlink, @link Magnum::Math::Literals::operator""_rgba() @endlink, @link Magnum::Math::Literals::operator""_rgbf() @endlink, @link Magnum::Math::Literals::operator""_rgbaf() @endlink, @link Magnum::Math::Literals::operator""_srgb() @endlink, @link Magnum::Math::Literals::operator""_srgba() @endlink, @link Magnum::Math::Literals::operator""_srgbf() @endlink, @link Magnum::Math::Literals::operator""_srgbaf() @endlink
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/Matrix.h"
#include "Magnum/Math/Packing.h"
#include "Magnum/Math/Vector4.h"

3
src/Magnum/Math/Complex.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Math::Complex, function @ref Magnum::Math::dot(), @ref Magnum::Math::angle()
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#ifndef CORRADE_SINGLES_NO_DEBUG
#include <Corrade/Utility/Debug.h>
#endif

3
src/Magnum/Math/Dual.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Math::Dual
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include <Corrade/Containers/Pair.h>
#ifndef CORRADE_SINGLES_NO_DEBUG
#include <Corrade/Utility/Debug.h>

4
src/Magnum/Math/DualComplex.h

@ -30,6 +30,10 @@
* @brief Class @ref Magnum::Math::DualComplex
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/Complex.h"
#include "Magnum/Math/Dual.h"
#include "Magnum/Math/Matrix3.h"

3
src/Magnum/Math/DualQuaternion.h

@ -30,6 +30,9 @@
* @brief Class @ref Magnum::Math::DualQuaternion, function @ref Magnum::Math::sclerp()
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include <Corrade/Utility/StlMath.h>
#include "Magnum/Math/Dual.h"

3
src/Magnum/Math/Frustum.h

@ -30,6 +30,9 @@
* @brief Class @ref Magnum::Math::Frustum
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include <Corrade/configure.h>
#ifndef CORRADE_SINGLES_NO_DEBUG
#include <Corrade/Utility/Debug.h>

3
src/Magnum/Math/FunctionsBatch.h

@ -30,6 +30,9 @@
*/
#include <initializer_list>
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include <Corrade/Containers/StridedArrayView.h>
#include "Magnum/Math/Functions.h"

4
src/Magnum/Math/Matrix.h

@ -29,6 +29,10 @@
* @brief Class @ref Magnum::Math::Matrix, alias @ref Magnum::Math::Matrix2x2, @ref Magnum::Math::Matrix3x3, @ref Magnum::Math::Matrix4x4
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/RectangularMatrix.h"
namespace Magnum { namespace Math {

4
src/Magnum/Math/Matrix3.h

@ -29,6 +29,10 @@
* @brief Class @ref Magnum::Math::Matrix3
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/Matrix.h"
#include "Magnum/Math/Vector3.h"

4
src/Magnum/Math/Matrix4.h

@ -29,6 +29,10 @@
* @brief Class @ref Magnum::Math::Matrix4
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/Matrix.h"
#include "Magnum/Math/Vector4.h"

3
src/Magnum/Math/Quaternion.h

@ -30,6 +30,9 @@
* @brief Class @ref Magnum::Math::Quaternion, function @ref Magnum::Math::dot(), @ref Magnum::Math::halfAngle(), @ref Magnum::Math::lerp(), @ref Magnum::Math::slerp()
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#ifndef CORRADE_SINGLES_NO_DEBUG
#include <Corrade/Utility/Debug.h>
#endif

4
src/Magnum/Math/Range.h

@ -29,6 +29,10 @@
* @brief Class @ref Magnum::Math::Range, @ref Magnum::Math::Range2D, @ref Magnum::Math::Range3D, alias @ref Magnum::Math::Range1D
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/Functions.h"
#include "Magnum/Math/Vector3.h"

4
src/Magnum/Math/RectangularMatrix.h

@ -29,6 +29,10 @@
* @brief Class @ref Magnum::Math::RectangularMatrix, alias @ref Magnum::Math::Matrix2x3, @ref Magnum::Math::Matrix3x2, @ref Magnum::Math::Matrix2x4, @ref Magnum::Math::Matrix4x2, @ref Magnum::Math::Matrix3x4, @ref Magnum::Math::Matrix4x3
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/Vector.h"
namespace Magnum { namespace Math {

3
src/Magnum/Math/Vector.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Math::Vector, function @ref Magnum::Math::dot(), @ref Magnum::Math::angle()
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include <Corrade/Containers/Pair.h>
#ifndef CORRADE_SINGLES_NO_DEBUG
#include <Corrade/Utility/Debug.h>

4
src/Magnum/Math/Vector2.h

@ -29,6 +29,10 @@
* @brief Class @ref Magnum::Math::Vector2, function @ref Magnum::Math::cross()
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/Vector.h"
namespace Magnum { namespace Math {

4
src/Magnum/Math/Vector3.h

@ -29,6 +29,10 @@
* @brief Class @ref Magnum::Math::Vector3, function @ref Magnum::Math::cross()
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/Vector2.h"
namespace Magnum { namespace Math {

4
src/Magnum/Math/Vector4.h

@ -29,6 +29,10 @@
* @brief Class @ref Magnum::Math::Vector4, function @ref Magnum::Math::planeEquation()
*/
/* std::declval() is said to be in <utility> but libstdc++, libc++ and MSVC STL
all have it directly in <type_traits> because it just makes sense */
#include <type_traits>
#include "Magnum/Math/Vector3.h"
namespace Magnum { namespace Math {

Loading…
Cancel
Save