mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-03 22:54:39 +00:00
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:
commit
e709046924
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user