diff --git a/src/DebugMarker.h b/src/DebugMarker.h index 942c38dad..54e1e1479 100644 --- a/src/DebugMarker.h +++ b/src/DebugMarker.h @@ -41,6 +41,8 @@ class MAGNUM_EXPORT DebugMarker { friend class Context; public: + DebugMarker() = delete; + /** @brief Put string mark into OpenGL command stream */ inline static void mark(const std::string& string) { markImplementation(string); diff --git a/src/DimensionTraits.h b/src/DimensionTraits.h index 016fc1ee0..ad3975501 100644 --- a/src/DimensionTraits.h +++ b/src/DimensionTraits.h @@ -37,6 +37,8 @@ namespace Math { /** @brief Matrix, point and vector specializations for given dimension count */ template struct DimensionTraits { + DimensionTraits() = delete; + #ifdef DOXYGEN_GENERATING_OUTPUT /** * @brief Vector type @@ -66,21 +68,29 @@ template struct DimensionTraits { #ifndef DOXYGEN_GENERATING_OUTPUT /* One dimension */ template struct DimensionTraits<1, T> { + DimensionTraits() = delete; + typedef Math::Vector<1, T> VectorType; }; /* Two dimensions - integral */ template struct DimensionTraits<2, T> { + DimensionTraits() = delete; + typedef Math::Vector2 VectorType; }; /* Two dimensions - floating-point */ template<> struct DimensionTraits<2, float> { + DimensionTraits() = delete; + typedef Math::Vector2 VectorType; typedef Math::Point2D PointType; typedef Math::Matrix3 MatrixType; }; template<> struct DimensionTraits<2, double> { + DimensionTraits() = delete; + typedef Math::Vector2 VectorType; typedef Math::Point2D PointType; typedef Math::Matrix3 MatrixType; @@ -88,16 +98,22 @@ template<> struct DimensionTraits<2, double> { /* Three dimensions - integral */ template struct DimensionTraits<3, T> { + DimensionTraits() = delete; + typedef Math::Vector3 VectorType; }; /* Three dimensions - floating-point */ template<> struct DimensionTraits<3, float> { + DimensionTraits() = delete; + typedef Math::Vector3 VectorType; typedef Math::Point3D PointType; typedef Math::Matrix4 MatrixType; }; template<> struct DimensionTraits<3, double> { + DimensionTraits() = delete; + typedef Math::Vector3 VectorType; typedef Math::Point3D PointType; typedef Math::Matrix4 MatrixType; diff --git a/src/Math/Algorithms/GaussJordan.h b/src/Math/Algorithms/GaussJordan.h index 2778fa5c2..30154fbab 100644 --- a/src/Math/Algorithms/GaussJordan.h +++ b/src/Math/Algorithms/GaussJordan.h @@ -31,6 +31,8 @@ http://elonen.iki.fi/code/misc-notes/python-gaussj/index.html. */ class GaussJordan { public: + GaussJordan() = delete; + /** * @brief Eliminate transposed matrices in place * @param a Transposed left side of augmented matrix diff --git a/src/Math/Constants.h b/src/Math/Constants.h index 0b27ae947..5e8e70e9b 100644 --- a/src/Math/Constants.h +++ b/src/Math/Constants.h @@ -27,6 +27,8 @@ namespace Magnum { namespace Math { @see Magnum::Constants */ template struct Constants { + Constants() = delete; + /* See MathTypeTraits for answer why these are functions and not constants. */ #ifdef DOXYGEN_GENERATING_OUTPUT /** @@ -43,11 +45,15 @@ template struct Constants { #ifndef DOXYGEN_GENERATING_OUTPUT template<> struct Constants { + Constants() = delete; + static inline constexpr double pi() { return 3.141592653589793; } static inline constexpr double sqrt2() { return 1.414213562373095; } static inline constexpr double sqrt3() { return 1.732050807568877; } }; template<> struct Constants { + Constants() = delete; + static inline constexpr float pi() { return 3.141592654f; } static inline constexpr float sqrt2() { return 1.414213562f; } static inline constexpr float sqrt3() { return 1.732050808f; } diff --git a/src/Math/Geometry/Distance.h b/src/Math/Geometry/Distance.h index 9073520a8..48fe043a1 100644 --- a/src/Math/Geometry/Distance.h +++ b/src/Math/Geometry/Distance.h @@ -28,6 +28,8 @@ namespace Magnum { namespace Math { namespace Geometry { /** @brief Functions for computing distances */ class Distance { public: + Distance() = delete; + /** * @brief %Distance of line and point in 2D * @param a First point of the line diff --git a/src/Math/Geometry/Intersection.h b/src/Math/Geometry/Intersection.h index 6eeba75bc..c3b13785c 100644 --- a/src/Math/Geometry/Intersection.h +++ b/src/Math/Geometry/Intersection.h @@ -26,6 +26,8 @@ namespace Magnum { namespace Math { namespace Geometry { /** @brief Functions for computing intersections */ class Intersection { public: + Intersection() = delete; + /** * @brief %Intersection of a plane and line * @param planePosition Plane position diff --git a/src/Math/MathTypeTraits.h b/src/Math/MathTypeTraits.h index a0b9f591d..7b4693cf6 100644 --- a/src/Math/MathTypeTraits.h +++ b/src/Math/MathTypeTraits.h @@ -46,6 +46,8 @@ sense, it has empty implementation for unknown types or types which don't support given feature, thus forcing the compilation stop with an error. */ template struct MathTypeTraits { + MathTypeTraits() = delete; + /* * The following values are implemented as inline functions, not as * static const variables, because the compiler will inline the return @@ -101,6 +103,8 @@ template struct MathTypeTraits { namespace Implementation { template struct MathTypeTraitsIntegral { + MathTypeTraitsIntegral() = delete; + inline constexpr static T epsilon() { return 1; } inline constexpr static bool equals(T a, T b) { @@ -109,6 +113,8 @@ template struct MathTypeTraitsIntegral { }; template struct MathTypeTraitsFloatingPoint { + MathTypeTraitsFloatingPoint() = delete; + inline static bool equals(T a, T b) { return std::abs(a - b) < MathTypeTraits::epsilon(); } diff --git a/src/Math/RectangularMatrix.h b/src/Math/RectangularMatrix.h index 014eebbf3..d4a2bb7e0 100644 --- a/src/Math/RectangularMatrix.h +++ b/src/Math/RectangularMatrix.h @@ -517,6 +517,8 @@ namespace Corrade { namespace Utility { /** @configurationvalue{Magnum::Math::RectangularMatrix} */ template struct ConfigurationValue> { + ConfigurationValue() = delete; + /** @brief Writes elements separated with spaces */ static std::string toString(const Magnum::Math::RectangularMatrix& value, ConfigurationValueFlags flags) { std::string output; diff --git a/src/Mesh.h b/src/Mesh.h index 100b343fb..f4cf516ad 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -754,6 +754,8 @@ namespace Corrade { namespace Utility { /** @configurationvalue{Magnum::Mesh} */ template<> struct MAGNUM_EXPORT ConfigurationValue { + ConfigurationValue() = delete; + /** * @brief Writes enum value as string * diff --git a/src/Platform/ExtensionWrangler.h b/src/Platform/ExtensionWrangler.h index 536a8c11b..5dc8d8147 100644 --- a/src/Platform/ExtensionWrangler.h +++ b/src/Platform/ExtensionWrangler.h @@ -24,6 +24,8 @@ namespace Magnum { namespace Platform { /** @brief %Extension wrangler interface */ class ExtensionWrangler { public: + ExtensionWrangler() = delete; + /** @brief Whether to enable or disable experimental features */ enum class ExperimentalFeatures { Disable, diff --git a/src/Renderer.h b/src/Renderer.h index 420c29cf9..e2274fc61 100644 --- a/src/Renderer.h +++ b/src/Renderer.h @@ -36,9 +36,9 @@ Access to global renderer configuration. @todo @extension{ARB,viewport_array} */ class MAGNUM_EXPORT Renderer { - Renderer() = delete; - public: + Renderer() = delete; + /** * @brief Affected polygon facing for culling, stencil operations and masks * diff --git a/src/SizeTraits.h b/src/SizeTraits.h index b2001f5ce..d221fcada 100644 --- a/src/SizeTraits.h +++ b/src/SizeTraits.h @@ -51,20 +51,26 @@ template struct SizeTraits { typedef T SizeType; }; #else -template struct SizeTraits: public SizeTraits {}; +template struct SizeTraits: public SizeTraits { + SizeTraits() = delete; +}; #endif #ifndef DOXYGEN_GENERATING_OUTPUT template<> struct SizeTraits<0> { + SizeTraits() = delete; typedef GLubyte SizeType; }; template<> struct SizeTraits<1> { + SizeTraits() = delete; typedef GLushort SizeType; }; template<> struct SizeTraits<2> { + SizeTraits() = delete; typedef GLuint SizeType; }; template<> struct SizeTraits<4> { + SizeTraits() = delete; /* We don't have size type to store 2^32 values */ }; #endif @@ -146,6 +152,8 @@ Useful mainly for computing template parameter value, e.g. in conjunction with SizeTraits class. */ template struct Pow { + Pow() = delete; + /** @brief Value of the power */ enum: std::uint32_t { #ifndef DOXYGEN_GENERATING_OUTPUT @@ -158,6 +166,8 @@ template struct Pow { #ifndef DOXYGEN_GENERATING_OUTPUT template struct Pow { + Pow() = delete; + enum: std::uint32_t { value = 1 }; }; #endif @@ -171,6 +181,8 @@ Useful mainly for computing template parameter value, e.g. in conjunction with SizeTraits class. */ template struct Log { + Log() = delete; + /** @brief Value of the logarithm */ enum: std::uint32_t { #ifndef DOXYGEN_GENERATING_OUTPUT @@ -182,10 +194,11 @@ template struct Log { }; #ifndef DOXYGEN_GENERATING_OUTPUT -template struct Log: public Log {}; template struct Log { + Log() = delete; enum: std::uint32_t { value = 0 }; }; +template struct Log: public Log {}; #endif } diff --git a/src/TypeTraits.h b/src/TypeTraits.h index be2d5fc81..9366bd872 100644 --- a/src/TypeTraits.h +++ b/src/TypeTraits.h @@ -86,7 +86,9 @@ template struct TypeTraits: Math::MathTypeTraits { inline constexpr static std::size_t count(); }; #else -template struct TypeTraits {}; +template struct TypeTraits { + TypeTraits() = delete; +}; #endif /** @brief OpenGL plain types */ @@ -124,6 +126,8 @@ type = TypeTraits::imageType(); @endcode */ template class TypeOf { + TypeOf() = delete; + #ifdef DOXYGEN_GENERATING_OUTPUT typedef U Type; /**< @brief Type */ #endif @@ -137,6 +141,8 @@ time, this class alows to get some information also at runtime with tiny performance loss. */ struct MAGNUM_EXPORT TypeInfo { + TypeInfo() = delete; + /** * @brief Size of given type * @@ -160,15 +166,39 @@ struct MAGNUM_EXPORT TypeInfo { /** @todo Using Vector3 for textures? */ #ifndef DOXYGEN_GENERATING_OUTPUT -template<> struct TypeOf { typedef GLubyte Type; }; -template<> struct TypeOf { typedef GLbyte Type; }; -template<> struct TypeOf { typedef GLushort Type; }; -template<> struct TypeOf { typedef GLshort Type; }; -template<> struct TypeOf { typedef GLuint Type; }; -template<> struct TypeOf { typedef GLint Type; }; -template<> struct TypeOf { typedef GLfloat Type; }; +template<> struct TypeOf { + TypeOf() = delete; + typedef GLubyte Type; +}; +template<> struct TypeOf { + TypeOf() = delete; + typedef GLbyte Type; +}; +template<> struct TypeOf { + TypeOf() = delete; + typedef GLushort Type; +}; +template<> struct TypeOf { + TypeOf() = delete; + typedef GLshort Type; +}; +template<> struct TypeOf { + TypeOf() = delete; + typedef GLuint Type; +}; +template<> struct TypeOf { + TypeOf() = delete; + typedef GLint Type; +}; +template<> struct TypeOf { + TypeOf() = delete; + typedef GLfloat Type; +}; #ifndef MAGNUM_TARGET_GLES -template<> struct TypeOf { typedef GLdouble Type; }; +template<> struct TypeOf { + TypeOf() = delete; + typedef GLdouble Type; +}; #endif template<> struct TypeTraits: Math::MathTypeTraits { @@ -239,6 +269,8 @@ template<> struct TypeTraits: Math::MathTypeTraits { namespace Implementation { template struct VectorTypeTraits { + VectorTypeTraits() = delete; + /* Might be used for attributes, see below */ inline constexpr static Type type() { return TypeTraits::type(); } /* Might be used for attributes, see below */ @@ -286,6 +318,8 @@ template struct TypeTraits>: TypeTraits> { namespace Implementation { template struct MatrixTypeTraits { + MatrixTypeTraits() = delete; + inline constexpr static Type type() { return TypeTraits::type(); } /* Might be used for attributes, see below */ /* Can not be used for indices */ @@ -332,6 +366,8 @@ namespace Corrade { namespace Utility { /** @configurationvalue{Magnum::TypeInfo} */ template<> struct MAGNUM_EXPORT ConfigurationValue { + ConfigurationValue() = delete; + /** * @brief Writes enum value as string *