mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
make explicit not_null move constructor so it is noexcept (#630)
* make explicit not_null move constructor so it is noexcept * added test for not_null being noexcet move constructible
This commit is contained in:
parent
7eb8f41af5
commit
ed3693fd2e
@ -82,6 +82,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
not_null(not_null&& other) = default;
|
||||
not_null(const not_null& other) = default;
|
||||
not_null& operator=(const not_null& other) = default;
|
||||
|
||||
|
@ -327,3 +327,5 @@ TEST_CASE("TestNotNullCustomPtrComparison")
|
||||
CHECK((NotNull1(p1) >= NotNull2(p2)) == (p1 >= p2));
|
||||
CHECK((NotNull2(p2) >= NotNull1(p1)) == (p2 >= p1));
|
||||
}
|
||||
|
||||
static_assert(std::is_nothrow_move_constructible<not_null<void *>>::value, "not_null must be no-throw move constructible");
|
||||
|
Loading…
Reference in New Issue
Block a user