Skip to content

Commit 89fd276

Browse files
committed
Style: Replace _NO_DISCARD_ macro with [[nodiscard]]
1 parent 5eb6e6b commit 89fd276

17 files changed

+16
-20
lines changed

include/godot_cpp/core/defs.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ namespace godot {
7474
#endif
7575
#endif
7676

77-
#ifndef _NO_DISCARD_
78-
#define _NO_DISCARD_ [[nodiscard]]
79-
#endif
80-
8177
// Windows badly defines a lot of stuff we'll never use. Undefine it.
8278
#ifdef _WIN32
8379
#undef min // override standard definition

include/godot_cpp/variant/aabb.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace godot {
4343

4444
class Variant;
4545

46-
struct _NO_DISCARD_ AABB {
46+
struct [[nodiscard]] AABB {
4747
Vector3 position;
4848
Vector3 size;
4949

include/godot_cpp/variant/basis.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
namespace godot {
3939

40-
struct _NO_DISCARD_ Basis {
40+
struct [[nodiscard]] Basis {
4141
Vector3 rows[3] = {
4242
Vector3(1, 0, 0),
4343
Vector3(0, 1, 0),

include/godot_cpp/variant/color.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace godot {
3737

3838
class String;
3939

40-
struct _NO_DISCARD_ Color {
40+
struct [[nodiscard]] Color {
4141
union {
4242
struct {
4343
float r;

include/godot_cpp/variant/plane.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace godot {
3838

3939
class Variant;
4040

41-
struct _NO_DISCARD_ Plane {
41+
struct [[nodiscard]] Plane {
4242
Vector3 normal;
4343
real_t d = 0;
4444

include/godot_cpp/variant/projection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct Rect2;
4444
struct Transform3D;
4545
struct Vector2;
4646

47-
struct _NO_DISCARD_ Projection {
47+
struct [[nodiscard]] Projection {
4848
enum Planes {
4949
PLANE_NEAR,
5050
PLANE_FAR,

include/godot_cpp/variant/quaternion.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
namespace godot {
3939

40-
struct _NO_DISCARD_ Quaternion {
40+
struct [[nodiscard]] Quaternion {
4141
union {
4242
struct {
4343
real_t x;

include/godot_cpp/variant/rect2.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class String;
4040
struct Rect2i;
4141
struct Transform2D;
4242

43-
struct _NO_DISCARD_ Rect2 {
43+
struct [[nodiscard]] Rect2 {
4444
Point2 position;
4545
Size2 size;
4646

include/godot_cpp/variant/rect2i.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace godot {
3939
class String;
4040
struct Rect2;
4141

42-
struct _NO_DISCARD_ Rect2i {
42+
struct [[nodiscard]] Rect2i {
4343
Point2i position;
4444
Size2i size;
4545

include/godot_cpp/variant/transform2d.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace godot {
3939

4040
class String;
4141

42-
struct _NO_DISCARD_ Transform2D {
42+
struct [[nodiscard]] Transform2D {
4343
// Warning #1: basis of Transform2D is stored differently from Basis. In terms of columns array, the basis matrix looks like "on paper":
4444
// M = (columns[0][0] columns[1][0])
4545
// (columns[0][1] columns[1][1])

include/godot_cpp/variant/transform3d.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
namespace godot {
4141

42-
struct _NO_DISCARD_ Transform3D {
42+
struct [[nodiscard]] Transform3D {
4343
Basis basis;
4444
Vector3 origin;
4545

include/godot_cpp/variant/vector2.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace godot {
3939
class String;
4040
struct Vector2i;
4141

42-
struct _NO_DISCARD_ Vector2 {
42+
struct [[nodiscard]] Vector2 {
4343
static const int AXIS_COUNT = 2;
4444

4545
enum Axis {

include/godot_cpp/variant/vector2i.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace godot {
3939
class String;
4040
struct Vector2;
4141

42-
struct _NO_DISCARD_ Vector2i {
42+
struct [[nodiscard]] Vector2i {
4343
static const int AXIS_COUNT = 2;
4444

4545
enum Axis {

include/godot_cpp/variant/vector3.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct Basis;
4141
struct Vector2;
4242
struct Vector3i;
4343

44-
struct _NO_DISCARD_ Vector3 {
44+
struct [[nodiscard]] Vector3 {
4545
static const int AXIS_COUNT = 3;
4646

4747
enum Axis {

include/godot_cpp/variant/vector3i.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace godot {
3939
class String;
4040
struct Vector3;
4141

42-
struct _NO_DISCARD_ Vector3i {
42+
struct [[nodiscard]] Vector3i {
4343
static const int AXIS_COUNT = 3;
4444

4545
enum Axis {

include/godot_cpp/variant/vector4.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace godot {
3838

3939
class String;
4040

41-
struct _NO_DISCARD_ Vector4 {
41+
struct [[nodiscard]] Vector4 {
4242
static const int AXIS_COUNT = 4;
4343

4444
enum Axis {

include/godot_cpp/variant/vector4i.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace godot {
3939
class String;
4040
struct Vector4;
4141

42-
struct _NO_DISCARD_ Vector4i {
42+
struct [[nodiscard]] Vector4i {
4343
static const int AXIS_COUNT = 4;
4444

4545
enum Axis {

0 commit comments

Comments
 (0)