https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122134
Bug ID: 122134
Summary: flat_set Mandates is_nothrow_swappable_v<KeyContainer>
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
Even though flat_set's swap is unconditionally noexcept, it doesn't mean we
should Mandates that swapping KeyContainer should be unconditionally noexcept,
right?
Some third-party containers might not meet this requirement, and rejecting them
would seem too restrictive.
Has this been discussed internally? Or is it better to wait until P3567R2 for a
fix? I have no opinion on this.
The following is a testcase:
#include <flat_set>
#include <llvm/ADT/SmallVector.h>
int main() {
llvm::SmallVector<int, 5> v;
std::flat_set s(v);
}
https://godbolt.org/z/andhn1c53