From c11d9b360ad5fa170b91862f46ba781566d12d7f Mon Sep 17 00:00:00 2001 From: Clark McGrew Date: Wed, 30 Jul 2025 15:13:13 -0400 Subject: [PATCH 1/3] Fix a "wow" spelling mistake Deprecate Range::isBellowMin() in favor of Range::isBelowMin() --- include/GenericToolbox.Macro.h | 2 +- include/GenericToolbox.Utils.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/GenericToolbox.Macro.h b/include/GenericToolbox.Macro.h index d32ab2f..31d7e53 100644 --- a/include/GenericToolbox.Macro.h +++ b/include/GenericToolbox.Macro.h @@ -31,7 +31,7 @@ #endif // HAS_CPP_11 -//#define WARN_DEPRECATED_FCT +#define WARN_DEPRECATED_FCT /* Always flag deprecation */ #ifndef WARN_DEPRECATED_FCT #define GT_DEPRECATED(msg_) // nothing #else diff --git a/include/GenericToolbox.Utils.h b/include/GenericToolbox.Utils.h index c7c4a25..52b14d5 100644 --- a/include/GenericToolbox.Utils.h +++ b/include/GenericToolbox.Utils.h @@ -422,7 +422,8 @@ namespace GenericToolbox{ [[nodiscard]] bool hasBound() const{ return hasLowerBound() or hasUpperBound(); } [[nodiscard]] bool hasBothBounds() const{ return hasLowerBound() and hasUpperBound(); } [[nodiscard]] bool isUnbounded() const{ return not hasBound(); } - [[nodiscard]] bool isBellowMin(double val_) const{ return (hasLowerBound() and val_ < min); } + [[nodiscard]] bool isBelowMin(double val_) const{ return (hasLowerBound() and val_ < min); } + [[nodiscard]] GT_DEPRECATED("Use isBelowMin") bool isBellowMin(double val_) const { return isBelowMin(val_); } [[nodiscard]] bool isAboveMax(double val_) const{ return (hasUpperBound() and val_ > max); } [[nodiscard]] bool isInBounds(double val_) const{ // both bounds are inclusive [min, max] From dc976db2208e0dec0202fb147b507f9a0e46bba3 Mon Sep 17 00:00:00 2001 From: Clark McGrew Date: Wed, 30 Jul 2025 15:23:13 -0400 Subject: [PATCH 2/3] Fix usage of deprecated method --- include/GenericToolbox.Utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/GenericToolbox.Utils.h b/include/GenericToolbox.Utils.h index 52b14d5..7bb8289 100644 --- a/include/GenericToolbox.Utils.h +++ b/include/GenericToolbox.Utils.h @@ -427,7 +427,7 @@ namespace GenericToolbox{ [[nodiscard]] bool isAboveMax(double val_) const{ return (hasUpperBound() and val_ > max); } [[nodiscard]] bool isInBounds(double val_) const{ // both bounds are inclusive [min, max] - if( isBellowMin(val_) ){ return false; } + if( isBelowMin(val_) ){ return false; } if( isAboveMax(val_) ){ return false; } return true; } From f21f76b594374a256cd6ba5f214948c2693107b3 Mon Sep 17 00:00:00 2001 From: Clark McGrew Date: Wed, 30 Jul 2025 15:27:56 -0400 Subject: [PATCH 3/3] Clarify deprecation message --- include/GenericToolbox.Utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/GenericToolbox.Utils.h b/include/GenericToolbox.Utils.h index 7bb8289..6d97c7d 100644 --- a/include/GenericToolbox.Utils.h +++ b/include/GenericToolbox.Utils.h @@ -423,7 +423,7 @@ namespace GenericToolbox{ [[nodiscard]] bool hasBothBounds() const{ return hasLowerBound() and hasUpperBound(); } [[nodiscard]] bool isUnbounded() const{ return not hasBound(); } [[nodiscard]] bool isBelowMin(double val_) const{ return (hasLowerBound() and val_ < min); } - [[nodiscard]] GT_DEPRECATED("Use isBelowMin") bool isBellowMin(double val_) const { return isBelowMin(val_); } + [[nodiscard]] GT_DEPRECATED("replace with isBelowMin()") bool isBellowMin(double val_) const { return isBelowMin(val_); } [[nodiscard]] bool isAboveMax(double val_) const{ return (hasUpperBound() and val_ > max); } [[nodiscard]] bool isInBounds(double val_) const{ // both bounds are inclusive [min, max]