Test empty function detection

This commit is contained in:
Jay Berkenbilt 2020-12-25 06:51:45 -05:00
parent 39bfa01307
commit 4cbe2abcc0
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,12 @@ void do_functional()
};
assert(make_addr_lambda(6)(8) == 14);
// nullptr and {} are empty functions
std::function<void()> f1 = {};
assert(! f1);
std::function<void()> f2 = nullptr;
assert(! f2);
}
// Integer types, type traits