fix typeinfo_pointer_cast usage

This commit is contained in:
HJfod 2024-08-20 12:56:32 +03:00
parent 28cc6fdbd3
commit 0d318ceda6

View file

@ -264,7 +264,7 @@ namespace geode {
template <class T> template <class T>
T getSettingValue(std::string_view const key) const { T getSettingValue(std::string_view const key) const {
using S = typename SettingTypeForValueType<T>::SettingType; using S = typename SettingTypeForValueType<T>::SettingType;
if (auto sett = typeinfo_pointer_cast<S>(this->getSettingV3(key))) { if (auto sett = cast::typeinfo_pointer_cast<S>(this->getSettingV3(key))) {
return sett->getValue(); return sett->getValue();
} }
return T(); return T();
@ -273,7 +273,7 @@ namespace geode {
template <class T> template <class T>
T setSettingValue(std::string_view const key, T const& value) { T setSettingValue(std::string_view const key, T const& value) {
using S = typename SettingTypeForValueType<T>::SettingType; using S = typename SettingTypeForValueType<T>::SettingType;
if (auto sett = typeinfo_pointer_cast<S>(this->getSettingV3(key))) { if (auto sett = cast::typeinfo_pointer_cast<S>(this->getSettingV3(key))) {
auto old = sett->getValue(); auto old = sett->getValue();
sett->setValue(value); sett->setValue(value);
return old; return old;