#pragma once namespace chatterino { void _registerSetting(std::weak_ptr setting); template class ChatterinoSetting : public pajlada::Settings::Setting { public: ChatterinoSetting(const std::string &_path) : pajlada::Settings::Setting(_path) { _registerSetting(this->data); } ChatterinoSetting(const std::string &_path, const Type &_defaultValue) : pajlada::Settings::Setting(_path, _defaultValue) { _registerSetting(this->data); } template ChatterinoSetting &operator=(const T2 &newValue) { this->setValue(newValue); return *this; } ChatterinoSetting &operator=(Type &&newValue) noexcept { pajlada::Settings::Setting::operator=(newValue); return *this; } using pajlada::Settings::Setting::operator==; using pajlada::Settings::Setting::operator!=; using pajlada::Settings::Setting::operator const Type; }; } // namespace chatterino