Modify

Opened 15 months ago

Closed 14 months ago

Last modified 14 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:

Description

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:

http://stackoverflow.com/questions/38166063/why-is-boostcontainerflat-set-not-nothrow-move-constructible

)

Attachments (0)

Change History (2)

comment:1 Changed 14 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:

https://github.com/boostorg/container/commit/225e2da77e65fa73a79b5acba1a8faf5e4abe25c

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

comment:2 Changed 14 months ago by anonymous

Cool, thank you

Modify Ticket

Change Properties
Set your email in Preferences
Action
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.