mirror of
https://github.com/BlackMATov/vmath.hpp.git
synced 2025-12-13 20:17:58 +07:00
style fixes
This commit is contained in:
34
README.md
34
README.md
@@ -96,9 +96,9 @@ public:
|
||||
explicit vec_base(T v);
|
||||
vec_base(T x, T y);
|
||||
|
||||
template < typename A > vec_base(const vec_base<A, 2>& xy);
|
||||
template < typename A > explicit vec_base(const vec_base<A, 3>& xy);
|
||||
template < typename A > explicit vec_base(const vec_base<A, 4>& xy);
|
||||
template < typename U > vec_base(const vec_base<U, 2>& other);
|
||||
template < typename U > explicit vec_base(const vec_base<U, 3>& other);
|
||||
template < typename U > explicit vec_base(const vec_base<U, 4>& other);
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
@@ -118,8 +118,8 @@ public:
|
||||
vec_base(const vec_base<T, 2>& xy, T z);
|
||||
vec_base(T x, const vec_base<T, 2>& yz);
|
||||
|
||||
template < typename A > vec_base(const vec_base<A, 3>& xyz);
|
||||
template < typename A > explicit vec_base(const vec_base<A, 4>& xyz);
|
||||
template < typename U > vec_base(const vec_base<U, 3>& other);
|
||||
template < typename U > explicit vec_base(const vec_base<U, 4>& other);
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
vec_base(const vec_base<T, 3>& xyz, T w);
|
||||
vec_base(T x, const vec_base<T, 3>& yzw);
|
||||
|
||||
template < typename A > vec_base(const vec_base<A, 4>& xyzw);
|
||||
template < typename U > vec_base(const vec_base<U, 4>& other);
|
||||
};
|
||||
|
||||
template < typename T, size_t Size >
|
||||
@@ -253,9 +253,9 @@ public:
|
||||
const row_type& row0,
|
||||
const row_type& row1);
|
||||
|
||||
template < typename A > mat_base(const mat_base<A, 2>& other);
|
||||
template < typename A > explicit mat_base(const mat_base<A, 3>& other);
|
||||
template < typename A > explicit mat_base(const mat_base<A, 4>& other);
|
||||
template < typename U > mat_base(const mat_base<U, 2>& other);
|
||||
template < typename U > explicit mat_base(const mat_base<U, 3>& other);
|
||||
template < typename U > explicit mat_base(const mat_base<U, 4>& other);
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
@@ -288,9 +288,9 @@ public:
|
||||
const mat_base<T, 2>& m,
|
||||
const vec_base<T, 2>& v);
|
||||
|
||||
template < typename A > mat_base(const mat_base<A, 3>& other);
|
||||
template < typename A > explicit mat_base(const mat_base<A, 2>& other);
|
||||
template < typename A > explicit mat_base(const mat_base<A, 4>& other);
|
||||
template < typename U > mat_base(const mat_base<U, 3>& other);
|
||||
template < typename U > explicit mat_base(const mat_base<U, 2>& other);
|
||||
template < typename U > explicit mat_base(const mat_base<U, 4>& other);
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
@@ -325,9 +325,9 @@ public:
|
||||
const mat_base<T, 3>& m,
|
||||
const vec_base<T, 3>& v);
|
||||
|
||||
template < typename A > mat_base(const mat_base<A, 4>& other);
|
||||
template < typename A > explicit mat_base(const mat_base<A, 2>& other);
|
||||
template < typename A > explicit mat_base(const mat_base<A, 3>& other);
|
||||
template < typename U > mat_base(const mat_base<U, 4>& other);
|
||||
template < typename U > explicit mat_base(const mat_base<U, 2>& other);
|
||||
template < typename U > explicit mat_base(const mat_base<U, 3>& other);
|
||||
};
|
||||
|
||||
template < typename T, size_t Size >
|
||||
@@ -427,8 +427,8 @@ public:
|
||||
qua_base(const vec<T, 3>& v, T s);
|
||||
explicit qua_base(const vec<T, 4>& vs);
|
||||
|
||||
template < typename A > qua_base(const qua_base<A, 4>& other);
|
||||
template < typename A > explicit operator vec<A, 4>() const;
|
||||
template < typename U > qua_base(const qua_base<U, 4>& other);
|
||||
template < typename U > explicit operator vec<U, 4>() const;
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
|
||||
@@ -52,18 +52,18 @@ namespace vmath_hpp::detail
|
||||
const row_type& row1)
|
||||
: rows{row0, row1} {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr mat_base(const mat_base<A, 2>& other): mat_base(
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr mat_base(const mat_base<U, 2>& other): mat_base(
|
||||
row_type{other.rows[0]},
|
||||
row_type{other.rows[1]}) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<A, 3>& other): mat_base(
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<U, 3>& other): mat_base(
|
||||
row_type{other.rows[0]},
|
||||
row_type{other.rows[1]}) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<A, 4>& other): mat_base(
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<U, 4>& other): mat_base(
|
||||
row_type{other.rows[0]},
|
||||
row_type{other.rows[1]}) {}
|
||||
};
|
||||
@@ -117,20 +117,20 @@ namespace vmath_hpp::detail
|
||||
{m.rows[1], T{0}},
|
||||
{v, T{1}}} {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr mat_base(const mat_base<A, 3>& other): mat_base(
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr mat_base(const mat_base<U, 3>& other): mat_base(
|
||||
row_type{other.rows[0]},
|
||||
row_type{other.rows[1]},
|
||||
row_type{other.rows[2]}) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<A, 2>& other): mat_base(
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<U, 2>& other): mat_base(
|
||||
row_type{other.rows[0], T{0}},
|
||||
row_type{other.rows[1], T{0}},
|
||||
row_type{T{0}, T{0}, T{1}}) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<A, 4>& other): mat_base(
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<U, 4>& other): mat_base(
|
||||
row_type{other.rows[0]},
|
||||
row_type{other.rows[1]},
|
||||
row_type{other.rows[2]}) {}
|
||||
@@ -191,22 +191,22 @@ namespace vmath_hpp::detail
|
||||
{m.rows[2], T{0}},
|
||||
{v, T{1}}} {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr mat_base(const mat_base<A, 4>& other): mat_base(
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr mat_base(const mat_base<U, 4>& other): mat_base(
|
||||
row_type{other.rows[0]},
|
||||
row_type{other.rows[1]},
|
||||
row_type{other.rows[2]},
|
||||
row_type{other.rows[3]}) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<A, 2>& other): mat_base(
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<U, 2>& other): mat_base(
|
||||
row_type{other.rows[0], T{0}, T{0}},
|
||||
row_type{other.rows[1], T{0}, T{0}},
|
||||
row_type{T{0}, T{0}, T{1}, T{0}},
|
||||
row_type{T{0}, T{0}, T{0}, T{1}}) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<A, 3>& other): mat_base(
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr explicit mat_base(const mat_base<U, 3>& other): mat_base(
|
||||
row_type{other.rows[0], T{0}},
|
||||
row_type{other.rows[1], T{0}},
|
||||
row_type{other.rows[2], T{0}},
|
||||
|
||||
@@ -30,11 +30,11 @@ namespace vmath_hpp::detail
|
||||
constexpr qua_base(const vec<T, 3>& v, T s): v{v}, s{s} {}
|
||||
constexpr explicit qua_base(const vec<T, 4>& vs): v{vs[0], vs[1], vs[2]}, s{vs[3]} {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr qua_base(const qua_base<A>& other): qua_base(other.v, other.s) {}
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr qua_base(const qua_base<U>& other): qua_base(other.v, other.s) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<T, A>, int> = 0 >
|
||||
constexpr explicit operator vec<A, 4>() const { return vec<A, 4>(v, s); }
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<T, U>, int> = 0 >
|
||||
constexpr explicit operator vec<U, 4>() const { return vec<U, 4>(v, s); }
|
||||
|
||||
[[nodiscard]] constexpr T& operator[](std::size_t index) noexcept {
|
||||
switch ( index ) {
|
||||
|
||||
@@ -28,14 +28,14 @@ namespace vmath_hpp::detail
|
||||
constexpr explicit vec_base(T v): x{v}, y{v} {}
|
||||
constexpr vec_base(T x, T y): x{x}, y{y} {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr vec_base(const vec_base<A, 2>& xy): vec_base(xy[0], xy[1]) {}
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr vec_base(const vec_base<U, 2>& other): vec_base(other[0], other[1]) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr explicit vec_base(const vec_base<A, 3>& xy): vec_base(xy[0], xy[1]) {}
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr explicit vec_base(const vec_base<U, 3>& other): vec_base(other[0], other[1]) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr explicit vec_base(const vec_base<A, 4>& xy): vec_base(xy[0], xy[1]) {}
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr explicit vec_base(const vec_base<U, 4>& other): vec_base(other[0], other[1]) {}
|
||||
|
||||
[[nodiscard]] constexpr T& operator[](std::size_t index) noexcept {
|
||||
switch ( index ) {
|
||||
@@ -72,11 +72,11 @@ namespace vmath_hpp::detail
|
||||
constexpr vec_base(const vec_base<T, 2>& xy, T z): vec_base(xy[0], xy[1], z) {}
|
||||
constexpr vec_base(T x, const vec_base<T, 2>& yz): vec_base(x, yz[0], yz[1]) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr vec_base(const vec_base<A, 3>& xyz): vec_base(xyz[0], xyz[1], xyz[2]) {}
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr vec_base(const vec_base<U, 3>& other): vec_base(other[0], other[1], other[2]) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr explicit vec_base(const vec_base<A, 4>& xyz): vec_base(xyz[0], xyz[1], xyz[2]) {}
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr explicit vec_base(const vec_base<U, 4>& other): vec_base(other[0], other[1], other[2]) {}
|
||||
|
||||
[[nodiscard]] constexpr T& operator[](std::size_t index) noexcept {
|
||||
switch ( index ) {
|
||||
@@ -120,8 +120,8 @@ namespace vmath_hpp::detail
|
||||
constexpr vec_base(const vec_base<T, 3>& xyz, T w): vec_base(xyz[0], xyz[1], xyz[2], w) {}
|
||||
constexpr vec_base(T x, const vec_base<T, 3>& yzw): vec_base(x, yzw[0], yzw[1], yzw[2]) {}
|
||||
|
||||
template < typename A, std::enable_if_t<std::is_convertible_v<A, T>, int> = 0 >
|
||||
constexpr vec_base(const vec_base<A, 4>& xyzw): vec_base(xyzw[0], xyzw[1], xyzw[2], xyzw[3]) {}
|
||||
template < typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0 >
|
||||
constexpr vec_base(const vec_base<U, 4>& other): vec_base(other[0], other[1], other[2], other[3]) {}
|
||||
|
||||
[[nodiscard]] constexpr T& operator[](std::size_t index) noexcept {
|
||||
switch ( index ) {
|
||||
|
||||
Reference in New Issue
Block a user