Define swap for std::unique_ptr

This commit is contained in:
Paul Licameli 2016-04-17 00:29:59 -04:00
parent 586074bab8
commit 9cc4eaadf8

View File

@ -185,6 +185,12 @@ namespace std {
}
}
void swap(unique_ptr& that)
{
std::swap(p, that.p);
std::swap(get_deleter(), that.get_deleter());
}
private:
T *p{};
};
@ -261,6 +267,12 @@ namespace std {
}
}
void swap(unique_ptr& that)
{
std::swap(p, that.p);
std::swap(get_deleter(), that.get_deleter());
}
private:
T *p{};
};