Skip to content

Commit

Permalink
Add ArgumentParser::mIsParsed to copied members
Browse files Browse the repository at this point in the history
MSVC 19.16 appears to be doing a copy rather than a move in
test_const_correct.  The copy ctor does not handle mIsParsed, so the
initial false value is kept.  This commit adds copying mIsParsed during
copy construction.

Signed-off-by: Sean Robinson <[email protected]>
  • Loading branch information
skrobinson committed Oct 27, 2021
1 parent af6bbc1 commit 500bc92
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/argparse/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ class ArgumentParser {

ArgumentParser(const ArgumentParser &other)
: mProgramName(other.mProgramName),
mIsParsed(other.mIsParsed),
mPositionalArguments(other.mPositionalArguments),
mOptionalArguments(other.mOptionalArguments) {
for (auto it = std::begin(mPositionalArguments); it != std::end(mPositionalArguments);
Expand Down

0 comments on commit 500bc92

Please sign in to comment.