mirror of
https://github.com/BlackMATov/vmath.hpp.git
synced 2025-12-16 22:19:51 +07:00
forced constexpr default ctors
This commit is contained in:
12
README.md
12
README.md
@@ -77,7 +77,7 @@ class vec_base<T, 2> {
|
||||
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<T, 3>& xy);
|
||||
@@ -89,7 +89,7 @@ class vec_base<T, 3> {
|
||||
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<T, 2>& xy, T z);
|
||||
@@ -102,7 +102,7 @@ class vec_base<T, 4> {
|
||||
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<T, 2>& 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(
|
||||
|
||||
@@ -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<T>) {
|
||||
for ( std::size_t i = 0; i < Size; ++i ) {
|
||||
|
||||
@@ -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<T>) {
|
||||
for ( std::size_t i = 0; i < Size; ++i ) {
|
||||
|
||||
Reference in New Issue
Block a user