mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 15:23:57 -04:00
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:
parent
e48044dc45
commit
aafa2f3998
@ -55,18 +55,18 @@ 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,
|
||||
const T bx, const T by, const T bz,
|
||||
const T cx, const T cy, const T cz)
|
||||
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)
|
||||
, b(bx,by,bz)
|
||||
, c(cx,cy,cz) {}
|
||||
|
@ -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) {}
|
||||
|
||||
|
@ -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) {}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user