mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-26 14:00:22 +00:00
Fix concepts related error (for compat with gcc9)
Signed-off-by: Lucca Jiménez Könings <development@jimkoen.com>
This commit is contained in:
1 file changed
+5
-4
+5
-4
@@ -193,8 +193,9 @@ struct Settings {
|
|||||||
}
|
}
|
||||||
map->at(key) = value;
|
map->at(key) = value;
|
||||||
}
|
}
|
||||||
template<std::same_as<int> T>
|
|
||||||
void set(Key key, T value) {
|
template<typename Integer, std::enable_if_t<std::is_same_v<Integer, int>, bool> = true>
|
||||||
|
void set(Key key, Integer value) {
|
||||||
auto map = SettingsMap.synchronize();
|
auto map = SettingsMap.synchronize();
|
||||||
if (!map->contains(key)) {
|
if (!map->contains(key)) {
|
||||||
throw std::logic_error { "Undefined setting key accessed in Settings::set(int)" };
|
throw std::logic_error { "Undefined setting key accessed in Settings::set(int)" };
|
||||||
@@ -204,8 +205,8 @@ struct Settings {
|
|||||||
}
|
}
|
||||||
map->at(key) = value;
|
map->at(key) = value;
|
||||||
}
|
}
|
||||||
template<std::same_as<bool> T>
|
template<typename Boolean, std::enable_if_t<std::is_same_v<bool, Boolean>, bool> = true>
|
||||||
void set(Key key, T value) {
|
void set(Key key, Boolean value) {
|
||||||
auto map = SettingsMap.synchronize();
|
auto map = SettingsMap.synchronize();
|
||||||
if (!map->contains(key)) {
|
if (!map->contains(key)) {
|
||||||
throw std::logic_error { "Undefined setting key accessed in Settings::set(bool)" };
|
throw std::logic_error { "Undefined setting key accessed in Settings::set(bool)" };
|
||||||
|
|||||||
Reference in new issue
Block a user