diff --git a/README.md b/README.md index 7388400..1ada1f6 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ class vec_base { public: T x{}, y{}; - vec_base() = default; + constexpr vec_base() = default; constexpr explicit vec_base(T v); constexpr vec_base(T x, T y); constexpr explicit vec_base(const vec_base& xy); @@ -89,7 +89,7 @@ class vec_base { public: T x{}, y{}, z{}; - vec_base() = default; + constexpr vec_base() = default; constexpr explicit vec_base(T v); constexpr vec_base(T x, T y, T z); constexpr vec_base(const vec_base& xy, T z); @@ -102,7 +102,7 @@ class vec_base { public: T x{}, y{}, z{}, w{}; - vec_base() = default; + constexpr vec_base() = default; constexpr explicit vec_base(T v); constexpr vec_base(T x, T y, T z, T w); constexpr vec_base(const vec_base& xy, T z, T w); @@ -179,7 +179,7 @@ public: {1, 0}, {0, 1}}; - mat_base() = default; + constexpr mat_base() = default; constexpr explicit mat_base(T v); constexpr mat_base( @@ -204,7 +204,7 @@ public: {0, 1, 0}, {0, 0, 1}}; - mat_base() = default; + constexpr mat_base() = default; constexpr explicit mat_base(T v); constexpr mat_base( @@ -232,7 +232,7 @@ public: {0, 0, 1, 0}, {0, 0, 0, 1}}; - mat_base() = default; + constexpr mat_base() = default; constexpr explicit mat_base(T v); constexpr mat_base( diff --git a/headers/vmath.hpp/vmath_mat.hpp b/headers/vmath.hpp/vmath_mat.hpp index ecb7a32..e843f00 100644 --- a/headers/vmath.hpp/vmath_mat.hpp +++ b/headers/vmath.hpp/vmath_mat.hpp @@ -24,7 +24,7 @@ namespace vmath_hpp::detail {1, 0}, {0, 1}}; public: - mat_base() = default; + constexpr mat_base() = default; constexpr explicit mat_base(T v) : rows{ @@ -65,7 +65,7 @@ namespace vmath_hpp::detail {0, 1, 0}, {0, 0, 1}}; public: - mat_base() = default; + constexpr mat_base() = default; constexpr explicit mat_base(T v) : rows{ @@ -113,7 +113,7 @@ namespace vmath_hpp::detail {0, 0, 1, 0}, {0, 0, 0, 1}}; public: - mat_base() = default; + constexpr mat_base() = default; constexpr explicit mat_base(T v) : rows{ @@ -179,13 +179,9 @@ namespace vmath_hpp using base_type::mat_base; using base_type::rows; - mat() = default; - - mat(mat&&) = default; - mat& operator=(mat&&) = default; - - mat(const mat&) = default; - mat& operator=(const mat&) = default; + constexpr mat() = default; + constexpr mat(const mat&) = default; + constexpr mat& operator=(const mat&) = default; void swap(mat& other) noexcept(std::is_nothrow_swappable_v) { for ( std::size_t i = 0; i < Size; ++i ) { diff --git a/headers/vmath.hpp/vmath_vec.hpp b/headers/vmath.hpp/vmath_vec.hpp index cd80289..3f37281 100644 --- a/headers/vmath.hpp/vmath_vec.hpp +++ b/headers/vmath.hpp/vmath_vec.hpp @@ -18,7 +18,7 @@ namespace vmath_hpp::detail public: T x{}, y{}; public: - vec_base() = default; + constexpr vec_base() = default; constexpr explicit vec_base(T v) : x{v}, y{v} {} @@ -54,7 +54,7 @@ namespace vmath_hpp::detail public: T x{}, y{}, z{}; public: - vec_base() = default; + constexpr vec_base() = default; constexpr explicit vec_base(T v) : x{v}, y{v}, z{v} {} @@ -95,7 +95,7 @@ namespace vmath_hpp::detail public: T x{}, y{}, z{}, w{}; public: - vec_base() = default; + constexpr vec_base() = default; constexpr explicit vec_base(T v) : x{v}, y{v}, z{v}, w{v} {} @@ -164,13 +164,9 @@ namespace vmath_hpp using base_type::vec_base; using base_type::operator[]; - vec() = default; - - vec(vec&&) = default; - vec& operator=(vec&&) = default; - - vec(const vec&) = default; - vec& operator=(const vec&) = default; + constexpr vec() = default; + constexpr vec(const vec&) = default; + constexpr vec& operator=(const vec&) = default; void swap(vec& other) noexcept(std::is_nothrow_swappable_v) { for ( std::size_t i = 0; i < Size; ++i ) {