Skip to content

Commit e6430db

Browse files
committed
Add constexpr specifier for Coordinate constructors
1 parent 90a05e2 commit e6430db

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/mcpp/util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ struct Coordinate {
2323
* @param y The y-coordinate.
2424
* @param z The z-coordinate.
2525
*/
26-
Coordinate(int x, int y, int z) : x(x), y(y), z(z) {}
26+
constexpr Coordinate(int x, int y, int z) : x(x), y(y), z(z) {}
2727

2828
/**
2929
* @brief Constructs a Coordinate object with zero values.
3030
*/
31-
Coordinate() : x(0), y(0), z(0) {}
31+
constexpr Coordinate() : x(0), y(0), z(0) {}
3232

3333
/**
3434
* @brief Constructs a Coordinate object with double values.
@@ -37,7 +37,7 @@ struct Coordinate {
3737
* @param y The y-coordinate as a double.
3838
* @param z The z-coordinate as a double.
3939
*/
40-
Coordinate(double x, double y, double z)
40+
constexpr Coordinate(double x, double y, double z)
4141
: x(static_cast<int>(x)), y(static_cast<int>(y)),
4242
z(static_cast<int>(z)) {}
4343

0 commit comments

Comments
 (0)