Skip to content

Commit 57d2bbf

Browse files
committed
Try marking default constructor as constexpr
1 parent 09f921e commit 57d2bbf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

OgreMain/include/OgreVector.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace Ogre
4545
/// helper class to implement legacy API. Notably x, y, z access
4646
template <int dims, typename T> struct VectorBase
4747
{
48-
VectorBase() {}
48+
constexpr VectorBase() {}
4949
constexpr VectorBase(T _x, T _y)
5050
{
5151
static_assert(dims > 1, "must have at least 2 dimensions");
@@ -67,7 +67,7 @@ namespace Ogre
6767
};
6868
template <> struct _OgreExport VectorBase<2, Real>
6969
{
70-
VectorBase() {}
70+
constexpr VectorBase() {}
7171
constexpr VectorBase(Real _x, Real _y) : x(_x), y(_y) {}
7272
Real x, y;
7373
Real* ptr() { return &x; }
@@ -127,7 +127,7 @@ namespace Ogre
127127

128128
template <> struct _OgreExport VectorBase<3, Real>
129129
{
130-
VectorBase() {}
130+
constexpr VectorBase() {}
131131
constexpr VectorBase(Real _x, Real _y, Real _z) : x(_x), y(_y), z(_z) {}
132132
Real x, y, z;
133133
Real* ptr() { return &x; }
@@ -256,7 +256,7 @@ namespace Ogre
256256

257257
template <> struct _OgreExport VectorBase<4, Real>
258258
{
259-
VectorBase() {}
259+
constexpr VectorBase() {}
260260
constexpr VectorBase(Real _x, Real _y, Real _z, Real _w) : x(_x), y(_y), z(_z), w(_w) {}
261261
Real x, y, z, w;
262262
Real* ptr() { return &x; }
@@ -282,7 +282,7 @@ namespace Ogre
282282
/** Default constructor.
283283
@note It does <b>NOT</b> initialize the vector for efficiency.
284284
*/
285-
Vector() {}
285+
constexpr Vector() {}
286286
constexpr Vector(T _x, T _y) : VectorBase<dims, T>(_x, _y) {}
287287
constexpr Vector(T _x, T _y, T _z) : VectorBase<dims, T>(_x, _y, _z) {}
288288
constexpr Vector(T _x, T _y, T _z, T _w) : VectorBase<dims, T>(_x, _y, _z, _w) {}

0 commit comments

Comments
 (0)