| 651 | } |
| 652 | |
| 653 | void swap(ProducerToken& other) MOODYCAMEL_NOEXCEPT |
| 654 | { |
| 655 | std::swap(producer, other.producer); |
| 656 | if (producer != nullptr) { |
| 657 | producer->token = this; |
| 658 | } |
| 659 | if (other.producer != nullptr) { |
| 660 | other.producer->token = &other; |
| 661 | } |
| 662 | } |
| 663 | |
| 664 | // A token is always valid unless: |
| 665 | // 1) Memory allocation failed during construction |
no test coverage detected