From c8d4c60f07df27590381ef28001a40f8f785f50e Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 27 Dec 2022 15:53:41 -0300 Subject: [PATCH] [osx] Fix error using std::any_cast() without a pointer as argument (not available in macOS 10.9) --- src/app/script/values.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/script/values.cpp b/src/app/script/values.cpp index 582484d6d..9a06c486d 100644 --- a/src/app/script/values.cpp +++ b/src/app/script/values.cpp @@ -105,14 +105,14 @@ template<> void push_value_to_lua(lua_State* L, const std::any& value) { if (!value.has_value()) lua_pushnil(L); - else if (const bool* v = std::any_cast(&value)) + else if (auto v = std::any_cast(&value)) push_value_to_lua(L, *v); - else if (const int* v = std::any_cast(&value)) + else if (auto v = std::any_cast(&value)) push_value_to_lua(L, *v); - else if (const std::string* v = std::any_cast(&value)) - push_value_to_lua(L, *v); - else if (const doc::Remap* v = std::any_cast(value)) + else if (auto v = std::any_cast(&value)) push_value_to_lua(L, *v); + else if (auto v = std::any_cast(&value)) + push_value_to_lua(L, **v); else { ASSERT(false); throw std::runtime_error("Cannot convert type inside std::any");