This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
hive::splice can throw bad_allocSection: 23.3.9.5 [hive.operations] Status: New Submitter: Jonathan Wakely Opened: 2025-11-07 Last modified: 2025-11-08
Priority: Not Prioritized
View other active issues in [hive.operations].
View all other issues in [hive.operations].
View all issues with New status.
Discussion:
Moving blocks from the source hive to the destination hive might require
reallocating the array of pointers to blocks, so the Throws: element
should allow this.
Proposed resolution:
This wording is relative to N5014.
Modify 23.3.9.5 [hive.operations], as indicated:
void splice(hive& x); void splice(hive&& x);-2- Preconditions:
get_allocator() == x.get_allocator()istrue.-3- Effects: If
addressof(x) == thisistrue, the behavior is erroneous and there are no effects. Otherwise, inserts the contents ofxinto*thisandxbecomes empty. Pointers and references to the moved elements ofxnow refer to those same elements but as members of*this. Iterators referring to the moved elements continue to refer to their elements, but they now behave as iterators into*this, not intox.-4- Throws:
length_errorif any ofx's active blocks are not within the bounds ofcurrent-limits, as well as any exceptions thrown by the allocator.-5- Complexity: Linear in the sum of all element blocks in
xplus all element blocks in*this.-6- Remarks: Reserved blocks in
xare not transferred into*this. Ifaddressof(x) == thisisfalse, invalidates the past-the-end iterator for bothxand*this.