From cd29f0faf9a76a30e3717617c400f80c6c0fa8f5 Mon Sep 17 00:00:00 2001 From: jatin Date: Tue, 20 May 2025 11:03:40 -0700 Subject: [PATCH] Fixes for MacOS 10.11 compatibility --- .../Structures/chowdsp_OptionalRef.h | 4 ++-- .../Structures/chowdsp_SmallVector.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/common/chowdsp_data_structures/Structures/chowdsp_OptionalRef.h b/modules/common/chowdsp_data_structures/Structures/chowdsp_OptionalRef.h index c9845df8..5a701b8e 100644 --- a/modules/common/chowdsp_data_structures/Structures/chowdsp_OptionalRef.h +++ b/modules/common/chowdsp_data_structures/Structures/chowdsp_OptionalRef.h @@ -54,14 +54,14 @@ class OptionalRef T& value() { if (! has_value()) - throw std::bad_optional_access(); + throw std::runtime_error { "bad_optional_access" }; // we can't actually use std::bad_optional_access here for MacOS compatibility! return *ptr; } const T& value() const { if (! has_value()) - throw std::bad_optional_access(); + throw std::runtime_error { "bad_optional_access" }; return *ptr; } diff --git a/modules/common/chowdsp_data_structures/Structures/chowdsp_SmallVector.h b/modules/common/chowdsp_data_structures/Structures/chowdsp_SmallVector.h index 6fe98b63..49a65121 100644 --- a/modules/common/chowdsp_data_structures/Structures/chowdsp_SmallVector.h +++ b/modules/common/chowdsp_data_structures/Structures/chowdsp_SmallVector.h @@ -536,22 +536,22 @@ class SmallVector auto& internal_array() { - return std::get<0> (internal_data); + return *std::get_if<0> (&internal_data); } const auto& internal_array() const { - return std::get<0> (internal_data); + return *std::get_if<0> (&internal_data); } auto& internal_vector() { - return std::get<1> (internal_data); + return *std::get_if<1> (&internal_data); } const auto& internal_vector() const { - return std::get<1> (internal_data); + return *std::get_if<1> (&internal_data); } struct ArrayStuff