style fixes

This commit is contained in:
BlackMATov
2021-02-26 10:43:40 +07:00
parent 7e1596acd1
commit 5589d7f70e
4 changed files with 51 additions and 51 deletions

View File

@@ -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}},

View File

@@ -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 ) {

View File

@@ -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 ) {