Add handler_ptr::has_value

This function returns `true` if the container holds a managed object.

Resolves: #1079

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
Damian Jarek
2018-05-18 17:25:56 -07:00
committed by Vinnie Falco
parent 344d957f42
commit 86555b90ae
3 changed files with 42 additions and 7 deletions
+2
View File
@@ -102,7 +102,9 @@ public:
{
handler_ptr<T, handler> p{handler{}};
bool b = false;
BEAST_EXPECT(p.has_value());
p.invoke(std::ref(b));
BEAST_EXPECT(! p.has_value());
BEAST_EXPECT(b);
}