Namespaces
Variants
Views
Actions

std::unique_ptr::swap

From cppreference.com
 
 
 
 
 
void swap(unique_ptr& other);
(since C++11)

Swaps the managed objects and associated deleters with another unique_ptr object other.

Contents

[edit] Parameters

other - another unique_ptr object to swap the managed object and the deleter with

[edit] Return value

(none)

[edit] Exceptions

noexcept specification:  
noexcept
  (since C++11)

[edit] Example