added unit test for checking that std::function works

This commit is contained in:
Zac Hansen 2018-04-13 01:31:06 -07:00
parent 63cf89f340
commit d1632e7a46

View File

@ -374,3 +374,11 @@ TEST_CASE("ConfirmCopyableAndMoveablePointerTypeNotRequired") {
gsl::not_null<UncopyableUnmovablePointerLikeType<int>> fixed_in_place(&i); gsl::not_null<UncopyableUnmovablePointerLikeType<int>> fixed_in_place(&i);
CHECK(*fixed_in_place == 5); CHECK(*fixed_in_place == 5);
} }
TEST_CASE("std::function") {
gsl::not_null<std::function<int()>> nnsf([](){return 4;});
CHECK(nnsf.get()() == 4);
std::function<int()> empty_function;
CHECK_THROWS(nnsf = empty_function);
}