Move bits from N4258. Mark vector's move-constructor unconditionally noexcept in C++1z

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242148 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2015-07-14 14:46:32 +00:00
parent 7d914d1bff
commit 119ed47999
3 changed files with 26 additions and 0 deletions

View File

@@ -43,7 +43,12 @@ int main()
}
{
typedef std::vector<bool, some_alloc<bool>> C;
// In C++17, move constructors for allocators are not allowed to throw
#if TEST_STD_VER > 14
static_assert( std::is_nothrow_move_constructible<C>::value, "");
#else
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
#endif
}
#endif
}

View File

@@ -44,7 +44,12 @@ int main()
}
{
typedef std::vector<MoveOnly, some_alloc<MoveOnly>> C;
// In C++17, move constructors for allocators are not allowed to throw
#if TEST_STD_VER > 14
static_assert( std::is_nothrow_move_constructible<C>::value, "");
#else
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
#endif
}
#endif
}