https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125693

--- Comment #5 from Marc Mutz <marc.mutz at hotmail dot com> ---
> I think this should be solved on the standard library side.

That was my expectation, yes. I figured it's protecting against the argument
aliasing into *this's storage and so by shuffling the elements invalidate it's
arg. So it takes a copy. On the stack. Boom. The element is larger than the
maximum possible stack. A rather expensive operation would be to take the copy
on the heap instead. As in push_back() + rotate into place, or as in
make_unique() + make hole + move-from-unique_ptr.

I tried to find whether the std has anything to say about limits pertaining to
this, but the only pertinent number in [implimits] is
https://eel.is/c++draft/implimits#1.17, and if the code would blow that one, I
guess the compiler would have warned way, way before it compiles
insert()/emplace().

Reply via email to