AP_Math: Remove template parameter from constructor

Not valid in C++20, and makes GCC 14.1.1 very unhappy.
This commit is contained in:
Michael du Breuil 2024-07-09 09:33:55 -07:00 committed by Peter Barker
parent e48044dc45
commit aafa2f3998
4 changed files with 12 additions and 12 deletions

View File

@ -55,16 +55,16 @@ public:
// trivial ctor
// note that the Vector3 ctor will zero the vector elements
constexpr Matrix3<T>() {}
constexpr Matrix3() {}
// setting ctor
constexpr Matrix3<T>(const Vector3<T> &a0, const Vector3<T> &b0, const Vector3<T> &c0)
constexpr Matrix3(const Vector3<T> &a0, const Vector3<T> &b0, const Vector3<T> &c0)
: a(a0)
, b(b0)
, c(c0) {}
// setting ctor
constexpr Matrix3<T>(const T ax, const T ay, const T az,
constexpr Matrix3(const T ax, const T ay, const T az,
const T bx, const T by, const T bz,
const T cx, const T cy, const T cz)
: a(ax,ay,az)

View File

@ -47,12 +47,12 @@ struct Vector2
T x, y;
// trivial ctor
constexpr Vector2<T>()
constexpr Vector2()
: x(0)
, y(0) {}
// setting ctor
constexpr Vector2<T>(const T x0, const T y0)
constexpr Vector2(const T x0, const T y0)
: x(x0)
, y(y0) {}

View File

@ -76,19 +76,19 @@ public:
T x, y, z;
// trivial ctor
constexpr Vector3<T>()
constexpr Vector3()
: x(0)
, y(0)
, z(0) {}
// setting ctor
constexpr Vector3<T>(const T x0, const T y0, const T z0)
constexpr Vector3(const T x0, const T y0, const T z0)
: x(x0)
, y(y0)
, z(z0) {}
//Create a Vector3 from a Vector2 with z
constexpr Vector3<T>(const Vector2<T> &v0, const T z0)
constexpr Vector3(const Vector2<T> &v0, const T z0)
: x(v0.x)
, y(v0.y)
, z(z0) {}

View File

@ -35,14 +35,14 @@ class VectorN
{
public:
// trivial ctor
inline VectorN<T,N>() {
inline VectorN() {
for (auto i = 0; i < N; i++) {
_v[i] = T{};
}
}
// vector ctor
inline VectorN<T,N>(const T *v) {
inline VectorN(const T *v) {
memcpy(_v, v, sizeof(T)*N);
}