Opened 20 months ago

Closed 19 months ago

Last modified 19 months ago

#12319 closed Bugs (fixed)

`boost::container::flat_set` should be nothrow move constructible

Reported by: beck.ct@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: container
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:


It appears to me that in a simple oversight, boost::container::flat_set is missing a noexcept declaration on its move constructor.

It is conditionally noexcept move assignable, assuming there are no allocator shenanigans. I'm not aware of a reason why something would be sometimes noexcept move assignable, but never move constructible.

It appears to me that the implementation in fact does not throw, so I *believe* this could be fixed quite easily.

It would help using this type with generic code in certain cases if it were marked thusly. Thank you.

(I earlier posted this on stackoverflow here:


Attachments (0)

Change History (2)

comment:1 Changed 19 months ago by Ion Gaztañaga

Resolution: fixed
Status: newclosed

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:

revises all default and move constructors and tries to better specify the minimum conditions to mark them as noexcept.

comment:2 Changed 19 months ago by anonymous

Cool, thank you

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ion Gaztañaga.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.