summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar lat9nq2023-06-11 00:41:14 -0400
committerGravatar lat9nq2023-07-21 10:56:54 -0400
commit4903f40efe7b0c193309708ea01bd6abea8bac16 (patch)
treebccec5f349aefe70fd30b5e328162c4776dca4d5 /src
parent(ui,)settings: Use explicit instantiation (diff)
downloadyuzu-4903f40efe7b0c193309708ea01bd6abea8bac16.tar.gz
yuzu-4903f40efe7b0c193309708ea01bd6abea8bac16.tar.xz
yuzu-4903f40efe7b0c193309708ea01bd6abea8bac16.zip
settings_setting: Fix errors
ToString didn't have a constexpr if statement where needed. Canonicalize missed an else, causing unreachable code error on MSVC.
Diffstat (limited to 'src')
-rw-r--r--src/common/settings_setting.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/settings_setting.h b/src/common/settings_setting.h
index f226e38d4..99a4bad01 100644
--- a/src/common/settings_setting.h
+++ b/src/common/settings_setting.h
@@ -142,7 +142,7 @@ protected:
142 return value_.has_value() ? std::to_string(*value_) : "none"; 142 return value_.has_value() ? std::to_string(*value_) : "none";
143 } else if constexpr (std::is_same<Type, bool>()) { 143 } else if constexpr (std::is_same<Type, bool>()) {
144 return value_ ? "true" : "false"; 144 return value_ ? "true" : "false";
145 } else if (std::is_same<Type, AudioEngine>()) { 145 } else if constexpr (std::is_same<Type, AudioEngine>()) {
146 return CanonicalizeEnum(value_); 146 return CanonicalizeEnum(value_);
147 } else { 147 } else {
148 return std::to_string(static_cast<u64>(value_)); 148 return std::to_string(static_cast<u64>(value_));
@@ -222,8 +222,9 @@ public:
222 [[nodiscard]] std::string constexpr Canonicalize() const override { 222 [[nodiscard]] std::string constexpr Canonicalize() const override {
223 if constexpr (std::is_enum<Type>::value) { 223 if constexpr (std::is_enum<Type>::value) {
224 return CanonicalizeEnum(this->GetValue()); 224 return CanonicalizeEnum(this->GetValue());
225 } else {
226 return ToString(this->GetValue());
225 } 227 }
226 return ToString(this->GetValue());
227 } 228 }
228 229
229 /** 230 /**