Merge pull request #380 from orenc17/fix-store_into-overload

Dont force store_into to override default/explicit values if already set
This commit is contained in:
Pranav 2024-09-20 09:02:13 -04:00 committed by GitHub
commit e709046924
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -691,7 +691,9 @@ public:
} }
auto &store_into(bool &var) { auto &store_into(bool &var) {
flag(); if ((!m_default_value.has_value()) && (!m_implicit_value.has_value())) {
flag();
}
if (m_default_value.has_value()) { if (m_default_value.has_value()) {
var = std::any_cast<bool>(m_default_value); var = std::any_cast<bool>(m_default_value);
} }