diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp index 394031d..c3ee214 100644 --- a/include/argparse/argparse.hpp +++ b/include/argparse/argparse.hpp @@ -691,7 +691,9 @@ class Argument { } auto &store_into(bool &var) { - flag(); + if ((!m_default_value.has_value()) && (!m_implicit_value.has_value())) { + flag(); + } if (m_default_value.has_value()) { var = std::any_cast<bool>(m_default_value); }