From 6f657d2a9b67b6df5c9746c02a193058d925698c Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 27 Apr 2023 14:57:33 +0100 Subject: [PATCH] CachedValue: Suppress float equality warnings --- modules/juce_data_structures/values/juce_CachedValue.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/juce_data_structures/values/juce_CachedValue.h b/modules/juce_data_structures/values/juce_CachedValue.h index 38cd2ad928..11f870b905 100644 --- a/modules/juce_data_structures/values/juce_CachedValue.h +++ b/modules/juce_data_structures/values/juce_CachedValue.h @@ -116,13 +116,18 @@ public: is equal to other. */ template - bool operator== (const OtherType& other) const { return cachedValue == other; } + bool operator== (const OtherType& other) const + { + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wfloat-equal") + return cachedValue == other; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + } /** Returns true if the current value of the property (or the fallback value) is not equal to other. */ template - bool operator!= (const OtherType& other) const { return cachedValue != other; } + bool operator!= (const OtherType& other) const { return ! operator== (other); } //============================================================================== /** Returns the current property as a Value object. */