| 1530 | void swap(variant &other) |
| 1531 | #if variant_CPP11_OR_GREATER |
| 1532 | noexcept( |
| 1533 | std::is_nothrow_move_constructible<T0>::value &&std17::is_nothrow_swappable< |
| 1534 | T0>::value &&std::is_nothrow_move_constructible<T1>::value |
| 1535 | &&std17::is_nothrow_swappable<T1>::value &&std::is_nothrow_move_constructible< |
| 1536 | T2>::value &&std17::is_nothrow_swappable<T2>::value |
| 1537 | &&std::is_nothrow_move_constructible<T3>::value &&std17::is_nothrow_swappable< |
| 1538 | T3>::value &&std::is_nothrow_move_constructible<T4>::value |
| 1539 | &&std17::is_nothrow_swappable<T4>::value &&std::is_nothrow_move_constructible< |
| 1540 | T5>::value &&std17::is_nothrow_swappable<T5>::value &&std:: |
| 1541 | is_nothrow_move_constructible<T6>::value &&std17::is_nothrow_swappable< |
| 1542 | T6>::value &&std::is_nothrow_move_constructible<T7>::value &&std17:: |
| 1543 | is_nothrow_swappable<T7>::value &&std::is_nothrow_move_constructible< |
| 1544 | T8>::value &&std17::is_nothrow_swappable<T8>::value |
| 1545 | &&std::is_nothrow_move_constructible< |
| 1546 | T9>::value &&std17::is_nothrow_swappable<T9>::value |
| 1547 | &&std::is_nothrow_move_constructible< |
| 1548 | T10>::value &&std17::is_nothrow_swappable<T10>::value |
| 1549 | &&std::is_nothrow_move_constructible< |
| 1550 | T11>::value &&std17::is_nothrow_swappable<T11>::value |
| 1551 | &&std::is_nothrow_move_constructible<T12>::value |
| 1552 | &&std17::is_nothrow_swappable<T12>::value && |
| 1553 | std::is_nothrow_move_constructible<T13>::value |
| 1554 | &&std17::is_nothrow_swappable<T13>::value |
| 1555 | &&std::is_nothrow_move_constructible< |
| 1556 | T14>::value |
| 1557 | &&std17::is_nothrow_swappable< |
| 1558 | T14>::value &&std:: |
| 1559 | is_nothrow_move_constructible< |
| 1560 | T15>::value &&std17:: |
| 1561 | is_nothrow_swappable< |
| 1562 | T15>::value |
| 1563 | |
| 1564 | ) |
| 1565 | #endif |
| 1566 | { |
| 1567 | if (valueless_by_exception() && other.valueless_by_exception()) { |
| 1568 | // no effect |
| 1569 | } else if (type_index == other.type_index) { |
| 1570 | this->swap_value(type_index, other); |
| 1571 | } else { |
| 1572 | #if variant_CPP11_OR_GREATER |
| 1573 | variant tmp(std::move(*this)); |
| 1574 | *this = std::move(other); |
| 1575 | other = std::move(tmp); |
| 1576 | #else |
| 1577 | variant tmp(*this); |
| 1578 | *this = other; |
| 1579 | other = tmp; |
| 1580 | #endif |
| 1581 | } |
| 1582 | } |
| 1583 | |
| 1584 | // |
| 1585 | // non-standard: |
no test coverage detected