Opened 12 years ago
Closed 10 years ago
#4927 closed Bugs (fixed)
Incorrect behavior of method clear() for class program_options::variables_map
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | Component: | program_options | |
Version: | Boost 1.49.0 | Severity: | Problem |
Keywords: | Cc: |
Description
The method clears only members inherited from the std::map. But what about other members of class variables_map (m_final, m_required)?
It is lead to strange behavior in next case:
1) parse default config file and fill corresponding "config file" variables_map;
2) parse command line (into another variables_map), get name of custom config file;
3) call clear() for "config file" variables_map and parse new file and refill "config file" variables_map again;
4) output all values of the "config file" variables_map and denote which of them are defaulted
Workaround: reassign new instance of variables_map instead call clear().
Change History (5)
comment:1 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 10 years ago
Milestone: | To Be Determined |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Version: | Boost 1.45.0 → Boost 1.49.0 |
This fix never made it into one of the release versions. Since then, 1.45.0 - 1.49.0 have been released without incorporating SVN rev. 67772.
Current trunk does include the fix.
follow-up: 4 comment:3 by , 10 years ago
It looks like you did not check release branch prior to reopening the issue? The fix is very much present there.
comment:4 by , 10 years ago
Replying to vladimir_prus:
It looks like you did not check release branch prior to reopening the issue? The fix is very much present there.
Well yes, but it still did not make it into any release after 1.45.0. Current 1.49.0 also does not contain it. Is it on track for 1.50.0? 17month seems like an awful long time for a fix to appear in a release... :(
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
It might be long, but given that it's already on release branch (which will become 1.50), it does not seem needed to keep this issue open.
(In [67772]) Implement variables_map::clear to clear extra members. Fixes #4927