Use std::is_nothrow_swappable (C++17 feature)

This commit is contained in:
Mat Sutcliffe
2021-04-17 22:58:11 +01:00
parent 76c59e88ea
commit 17d6e86c19
2 changed files with 1 additions and 14 deletions

View File

@@ -121,7 +121,7 @@ namespace BlackMisc
* Efficient swap for two Optional objects.
*/
template <typename T>
void swap(Optional<T> &a, Optional<T> &b) noexcept(Private::is_nothrow_swappable<T, T>::value)
void swap(Optional<T> &a, Optional<T> &b) noexcept(std::is_nothrow_swappable_v<T>)
{
if (a)
{