Boost C++ Libraries: Ticket #12319: `boost::container::flat_set` should be nothrow move constructible https://svn.boost.org/trac10/ticket/12319 <p> It appears to me that in a simple oversight, <code>boost::container::flat_set</code> is missing a <code>noexcept</code> declaration on its move constructor. </p> <p> It is conditionally <code>noexcept</code> move assignable, assuming there are no allocator shenanigans. I'm not aware of a reason why something would be sometimes <code>noexcept</code> move assignable, but never move constructible. </p> <p> It appears to me that the implementation in fact does not throw, so I *believe* this could be fixed quite easily. </p> <p> It would help using this type with generic code in certain cases if it were marked thusly. Thank you. </p> <p> (I earlier posted this on stackoverflow here: </p> <p> <a class="ext-link" href="http://stackoverflow.com/questions/38166063/why-is-boostcontainerflat-set-not-nothrow-move-constructible"><span class="icon">​</span>http://stackoverflow.com/questions/38166063/why-is-boostcontainerflat-set-not-nothrow-move-constructible</a> </p> <p> ) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12319 Trac 1.4.3 Ion Gaztañaga Mon, 01 Aug 2016 21:56:12 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12319#comment:1 https://svn.boost.org/trac10/ticket/12319#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> Thanks for the report. I've revised the standard and several STL implementations, and they all agree that associative containers' move constructor can't be unconditionally noexcept since they need to move construct the comparison predicate from the source container. However, they can be noexcept if the Compare's move constructor is noexcept. The commit: </p> <p> <a class="ext-link" href="https://github.com/boostorg/container/commit/225e2da77e65fa73a79b5acba1a8faf5e4abe25c"><span class="icon">​</span>https://github.com/boostorg/container/commit/225e2da77e65fa73a79b5acba1a8faf5e4abe25c</a> </p> <p> revises all default and move constructors and tries to better specify the minimum conditions to mark them as noexcept. </p> Ticket anonymous Wed, 03 Aug 2016 00:45:09 GMT <link>https://svn.boost.org/trac10/ticket/12319#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12319#comment:2</guid> <description> <p> Cool, thank you </p> </description> <category>Ticket</category> </item> </channel> </rss>