forked from TartanLlama/expected
More void support
This commit is contained in:
@@ -15,6 +15,13 @@ TEST_CASE("Triviality", "[bases.triviality]") {
|
||||
REQUIRE(std::is_trivially_move_assignable<tl::expected<int,int>>::value);
|
||||
REQUIRE(std::is_trivially_destructible<tl::expected<int,int>>::value);
|
||||
|
||||
REQUIRE(std::is_trivially_copy_constructible<tl::expected<void,int>>::value);
|
||||
REQUIRE(std::is_trivially_copy_assignable<tl::expected<void,int>>::value);
|
||||
REQUIRE(std::is_trivially_move_constructible<tl::expected<void,int>>::value);
|
||||
REQUIRE(std::is_trivially_move_assignable<tl::expected<void,int>>::value);
|
||||
REQUIRE(std::is_trivially_destructible<tl::expected<void,int>>::value);
|
||||
|
||||
|
||||
{
|
||||
struct T {
|
||||
T(const T&) = default;
|
||||
|
||||
@@ -120,4 +120,15 @@ TEST_CASE("Constructors", "[constructors]") {
|
||||
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);
|
||||
# endif
|
||||
}
|
||||
|
||||
{
|
||||
tl::expected<void,int> e;
|
||||
REQUIRE(e);
|
||||
}
|
||||
|
||||
{
|
||||
tl::expected<void,int> e (tl::unexpect, 42);
|
||||
REQUIRE(!e);
|
||||
REQUIRE(e.error() == 42);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user