aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Hansen <xaxxon@gmail.com>2018-03-03 15:53:23 -0800
committerNeil MacIntosh <neilmac@fb.com>2018-03-03 15:53:23 -0800
commited3693fd2e6d3dcc20acb6be23cfbf2d1cbb8ecd (patch)
tree2e102092da682cc14dd2d5129197af2b4927a973
parent7eb8f41af544941c712916dc0cb2c6c6ef7768ac (diff)
downloadplatform_external_Microsoft-GSL-ed3693fd2e6d3dcc20acb6be23cfbf2d1cbb8ecd.tar.gz
platform_external_Microsoft-GSL-ed3693fd2e6d3dcc20acb6be23cfbf2d1cbb8ecd.tar.bz2
platform_external_Microsoft-GSL-ed3693fd2e6d3dcc20acb6be23cfbf2d1cbb8ecd.zip
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
-rw-r--r--include/gsl/pointers1
-rw-r--r--tests/notnull_tests.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/include/gsl/pointers b/include/gsl/pointers
index 163a2fe..b2804a3 100644
--- a/include/gsl/pointers
+++ b/include/gsl/pointers
@@ -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;
diff --git a/tests/notnull_tests.cpp b/tests/notnull_tests.cpp
index 4baf7b3..a7ef27e 100644
--- a/tests/notnull_tests.cpp
+++ b/tests/notnull_tests.cpp
@@ -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");