From 4471dab289cdd45762155ce0b16472e95a7f8642 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 9 Jun 2022 19:06:16 -0300 Subject: [PATCH] [osx] We cannot use std::optional::value() if we want to support macOS 10.9 It looks like value() member was introduced in macOS 10.13 (error detected because we use CMAKE_OSX_DEPLOYMENT_TARGET=10.9). --- docs/CODING_STYLE.md | 2 ++ src/app/app.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CODING_STYLE.md b/docs/CODING_STYLE.md index d353bae5b..0604bf24b 100644 --- a/docs/CODING_STYLE.md +++ b/docs/CODING_STYLE.md @@ -143,6 +143,8 @@ We are using C++17 standard. You can safely use: * Use `std::shared_ptr`, `std::unique_ptr`, or `base::Ref` * Use `std::clamp` * Use `std::optional` + * Use `std::optional::operator*` (because `std::optional::value` isn't + available on macOS 10.9, only since 10.13) * Use `static constexpr T v = ...;` * You can use ``, ``, ``, and `` * Prefer `using T = ...;` instead of `typedef ... T` diff --git a/src/app/app.cpp b/src/app/app.cpp index 5d09d32ae..1236e6a95 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -636,7 +636,7 @@ bool App::isPortable() base::get_file_path(base::get_app_path()), "aseprite.ini")); } - return is_portable.value(); + return *is_portable; } tools::ToolBox* App::toolBox() const