From b46edc31cefb6a078742ba338da9b1de2efc649d Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 4 Jan 2023 14:02:08 +0000 Subject: [PATCH] Optional: Make operator bool() explicit --- modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp | 2 +- modules/juce_core/containers/juce_Optional.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index 8502d0fb69..f0c7228853 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -1073,7 +1073,7 @@ namespace AAXClasses return transport.IsTransportPlaying (&isPlaying) == AAX_SUCCESS && isPlaying; }()); - info.setIsRecording (recordingState.get()); + info.setIsRecording (recordingState.get().orFallback (false)); const auto optionalTimeInSamples = [&info, &transport] { diff --git a/modules/juce_core/containers/juce_Optional.h b/modules/juce_core/containers/juce_Optional.h index 63bcbd9ffa..b7609278e3 100644 --- a/modules/juce_core/containers/juce_Optional.h +++ b/modules/juce_core/containers/juce_Optional.h @@ -126,7 +126,7 @@ public: decltype (auto) operator* () { return opt.operator* (); } decltype (auto) operator* () const { return opt.operator* (); } - operator bool() const noexcept { return opt.has_value(); } + explicit operator bool() const noexcept { return opt.has_value(); } bool hasValue() const noexcept { return opt.has_value(); } template