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