Boost C++ Libraries: Ticket #4927: Incorrect behavior of method clear() for class program_options::variables_map https://svn.boost.org/trac10/ticket/4927 <p> The method clears only members inherited from the std::map. But what about other members of class variables_map (m_final, m_required)? </p> <p> It is lead to strange behavior in next case: </p> <blockquote> <p> 1) parse default config file and fill corresponding "config file" variables_map; </p> </blockquote> <blockquote> <p> 2) parse command line (into another variables_map), get name of custom config file; </p> </blockquote> <blockquote> <p> 3) call clear() for "config file" variables_map and parse new file and refill "config file" variables_map again; </p> </blockquote> <blockquote> <p> 4) output all values of the "config file" variables_map and denote which of them are defaulted </p> </blockquote> <p> Workaround: reassign new instance of variables_map instead call clear(). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4927 Trac 1.4.3 Vladimir Prus Sat, 08 Jan 2011 10:39:25 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4927#comment:1 https://svn.boost.org/trac10/ticket/4927#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/67772" title="Implement variables_map::clear to clear extra members. Fixes #4927 ">[67772]</a>) Implement variables_map::clear to clear extra members. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4927" title="#4927: Bugs: Incorrect behavior of method clear() for class ... (closed: fixed)">#4927</a> </p> Ticket boost-bugs@… Thu, 31 May 2012 21:21:28 GMT status, version changed; resolution, milestone deleted https://svn.boost.org/trac10/ticket/4927#comment:2 https://svn.boost.org/trac10/ticket/4927#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.45.0</span> → <span class="trac-field-new">Boost 1.49.0</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-deleted">To Be Determined</span> </li> </ul> <p> 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. </p> <p> Current trunk does include the fix. </p> Ticket Vladimir Prus Fri, 01 Jun 2012 07:22:20 GMT <link>https://svn.boost.org/trac10/ticket/4927#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4927#comment:3</guid> <description> <p> It looks like you did not check release branch prior to reopening the issue? The fix is very much present there. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 01 Jun 2012 07:50:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4927#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4927#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4927#comment:3" title="Comment 3">vladimir_prus</a>: </p> <blockquote class="citation"> <p> It looks like you did not check release branch prior to reopening the issue? The fix is very much present there. </p> </blockquote> <p> 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... :( </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Fri, 01 Jun 2012 07:54:08 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4927#comment:5 https://svn.boost.org/trac10/ticket/4927#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> 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. </p> Ticket