Skip to content

Fixes for MacOS 10.11 compatibility #589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,22 +536,22 @@

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);

Check warning on line 549 in modules/common/chowdsp_data_structures/Structures/chowdsp_SmallVector.h

View check run for this annotation

Codecov / codecov/patch

modules/common/chowdsp_data_structures/Structures/chowdsp_SmallVector.h#L549

Added line #L549 was not covered by tests
}

const auto& internal_vector() const
{
return std::get<1> (internal_data);
return *std::get_if<1> (&internal_data);

Check warning on line 554 in modules/common/chowdsp_data_structures/Structures/chowdsp_SmallVector.h

View check run for this annotation

Codecov / codecov/patch

modules/common/chowdsp_data_structures/Structures/chowdsp_SmallVector.h#L554

Added line #L554 was not covered by tests
}

struct ArrayStuff
Expand Down