Subject: [Boost-bugs] [Boost C++ Libraries] #4927: Incorrect behavior of method clear() for class program_options::variables_map
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-12-03 17:14:37
#4927: Incorrect behavior of method clear() for class
program_options::variables_map
------------------------------------+---------------------------------------
Reporter: degtyariov.a@⦠| Owner: vladimir_prus
Type: Bugs | Status: new
Milestone: To Be Determined | Component: program_options
Version: Boost 1.45.0 | Severity: Problem
Keywords: |
------------------------------------+---------------------------------------
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().
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4927> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC