Boost C++ Libraries: Ticket #6164: Add a function to dynamic_bitset to test and set https://svn.boost.org/trac10/ticket/6164 <p> I often use an idiom: </p> <blockquote> <p> if (!dynBitset.test(pos)) { </p> <blockquote> <p> dynBitset.set(pos); <em> do a once-only operation </em></p> </blockquote> </blockquote> <p> It would be nice to have something like: </p> <blockquote> <p> if (!dynBitset.test_set(pos)) { </p> <blockquote> <p> <em> do a once-only operation </em></p> </blockquote> </blockquote> <p> Yes, it could be done by saving a temporary reference, but this form is compact and easy to understand. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6164 Trac 1.4.3 Chris Kingsley <chris.kingsley@…> Tue, 22 Nov 2011 19:13:34 GMT attachment set https://svn.boost.org/trac10/ticket/6164 https://svn.boost.org/trac10/ticket/6164 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">msg1122.txt</span> </li> </ul> <p> a diff of current dynamic_bitset.hpp and my changed version </p> Ticket Chris Kingsley <chris.kingsley@…> Wed, 23 Nov 2011 16:42:04 GMT <link>https://svn.boost.org/trac10/ticket/6164#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6164#comment:1</guid> <description> <p> By the way, it might be worth noting that this isn't pretending to be an *atomic* test and set. There are specific machine instructions that do test and set atomically, used for synchronization. I don't think dynamic_bitset should consider being used as a synchronizer, so it shouldn't use the slower atomic operations. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>acharles</dc:creator> <pubDate>Fri, 21 Feb 2014 12:03:57 GMT</pubDate> <title>owner, status, severity, milestone changed https://svn.boost.org/trac10/ticket/6164#comment:2 https://svn.boost.org/trac10/ticket/6164#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">jsiek</span> to <span class="trac-author">acharles</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>severity</strong> <span class="trac-field-old">Optimization</span> → <span class="trac-field-new">Not Applicable</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> Ticket acharles Sun, 02 Mar 2014 02:30:18 GMT <link>https://svn.boost.org/trac10/ticket/6164#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6164#comment:3</guid> <description> <p> Fix in develop. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>acharles</dc:creator> <pubDate>Thu, 13 Mar 2014 21:42:25 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6164#comment:4 https://svn.boost.org/trac10/ticket/6164#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket