| 472 | } |
| 473 | |
| 474 | void vector_basic::move_from(vector_basic& other) FL_NOEXCEPT { |
| 475 | if (other.isInline()) { |
| 476 | // Can't steal inline buffer — must move elements |
| 477 | reserve_impl(other.mSize); |
| 478 | if (mOps) { |
| 479 | mOps->uninitialized_move_n(mArray, other.mArray, other.mSize); |
| 480 | } else { |
| 481 | if (other.mSize > 0) { |
| 482 | trivial_copy(mArray, other.mArray, other.mSize); |
| 483 | } |
| 484 | } |
| 485 | mSize = other.mSize; |
| 486 | mResource = other.mResource; |
| 487 | other.mSize = 0; |
| 488 | } else { |
| 489 | // Steal heap pointer |
| 490 | mArray = other.mArray; |
| 491 | mSize = other.mSize; |
| 492 | mCapacity = other.mCapacity; |
| 493 | mResource = other.mResource; |
| 494 | |
| 495 | // Leave other in valid empty state |
| 496 | if (other.hasInlineBuffer()) { |
| 497 | other.mArray = other.inlineBufferPtr(); |
| 498 | other.mCapacity = other.mInlineCapacity; |
| 499 | } else { |
| 500 | other.mArray = nullptr; |
| 501 | other.mCapacity = 0; |
| 502 | } |
| 503 | other.mSize = 0; |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | void vector_basic::move_assign(vector_basic& other) FL_NOEXCEPT { |
| 508 | if (this == &other) return; |
no test coverage detected