diff --git a/tests/notnull_tests.cpp b/tests/notnull_tests.cpp index 3d53d31..c3fb388 100644 --- a/tests/notnull_tests.cpp +++ b/tests/notnull_tests.cpp @@ -374,3 +374,11 @@ TEST_CASE("ConfirmCopyableAndMoveablePointerTypeNotRequired") { gsl::not_null> fixed_in_place(&i); CHECK(*fixed_in_place == 5); } + + +TEST_CASE("std::function") { + gsl::not_null> nnsf([](){return 4;}); + CHECK(nnsf.get()() == 4); + std::function empty_function; + CHECK_THROWS(nnsf = empty_function); +}