std::expected: fix and test move
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Nov 2017 19:19:30 +0000 (19:19 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Nov 2017 19:19:30 +0000 (19:19 +0000)
commitf740540c09239ced403aa136f37b7e6e8d0fd6fa
treec5e0f860e1e644dda53bfe0db1393e4399193be9
parent0e792fe96673430a8cade94f3f9f06b800dfaa40
std::expected: fix and test move
https://bugs.webkit.org/show_bug.cgi?id=179617

Reviewed by Alex Christensen.

Source/WTF:

Non-copyable move types should be able to be in an expected
properly.

* wtf/Expected.h:
(WTF::Expected::value const):
(WTF::Expected::error):
(WTF::Expected::error const):

Tools:

Test that unique_ptr can be moved around properly, both has a
value and an error (and in a <void, unique> specialization).

* TestWebKitAPI/Tests/WTF/Expected.cpp:
(TestWebKitAPI::snowflake::reset):
(TestWebKitAPI::snowflake::snowflake):
(TestWebKitAPI::snowflake::~snowflake):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/Expected.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/Expected.cpp