From 0782e3ba851506e9c2216eedafca84d163b9397e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2022 20:18:00 -0500 Subject: [PATCH] tweak flags types --- Marlin/src/core/types.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index fc3ef178b6df8..335aa3a334492 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -99,8 +99,8 @@ struct Flags { void set(const int n) { b |= (bits_t)_BV(n); } void clear(const int n) { b &= ~(bits_t)_BV(n); } bool test(const int n) const { return TEST(b, n); } - bool operator[](const int n) { return test(n); } - bool operator[](const int n) const { return test(n); } + const bool operator[](const int n) { return test(n); } + const bool operator[](const int n) const { return test(n); } int size() const { return sizeof(b); } }; @@ -113,8 +113,8 @@ struct Flags<1> { void set(const int) { b = true; } void clear(const int) { b = false; } bool test(const int) const { return b; } - bool operator[](const int) { return b; } - bool operator[](const int) const { return b; } + bool& operator[](const int) { return b; } + bool operator[](const int) const { return b; } int size() const { return sizeof(b); } };