forked from TartanLlama/expected
Fixed compilation on "is_trivially_*" traits on GCC4.8+
This commit is contained in:
@@ -65,51 +65,59 @@ TEST_CASE("Constructors", "[constructors]") {
|
||||
tl::expected<int, int> e;
|
||||
REQUIRE(std::is_default_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_copy_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_trivially_copy_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_trivially_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_copy_assignable<decltype(e)>::value);
|
||||
REQUIRE(std::is_trivially_copy_assignable<decltype(e)>::value);
|
||||
REQUIRE(std::is_move_assignable<decltype(e)>::value);
|
||||
REQUIRE(std::is_trivially_move_assignable<decltype(e)>::value);
|
||||
REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e)));
|
||||
REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e)));
|
||||
# if !defined(TL_EXPECTED_GCC49)
|
||||
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);
|
||||
# endif
|
||||
}
|
||||
|
||||
{
|
||||
tl::expected<int, std::string> e;
|
||||
REQUIRE(std::is_default_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_copy_constructible<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_copy_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_copy_assignable<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_copy_assignable<decltype(e)>::value);
|
||||
REQUIRE(std::is_move_assignable<decltype(e)>::value);
|
||||
REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e)));
|
||||
REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e)));
|
||||
# if !defined(TL_EXPECTED_GCC49)
|
||||
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);
|
||||
# endif
|
||||
}
|
||||
|
||||
{
|
||||
tl::expected<std::string, int> e;
|
||||
REQUIRE(std::is_default_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_copy_constructible<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_copy_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_copy_assignable<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_copy_assignable<decltype(e)>::value);
|
||||
REQUIRE(std::is_move_assignable<decltype(e)>::value);
|
||||
REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e)));
|
||||
REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e)));
|
||||
# if !defined(TL_EXPECTED_GCC49)
|
||||
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);
|
||||
# endif
|
||||
}
|
||||
|
||||
{
|
||||
tl::expected<std::string, std::string> e;
|
||||
REQUIRE(std::is_default_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_copy_constructible<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_copy_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(std::is_copy_assignable<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_copy_assignable<decltype(e)>::value);
|
||||
REQUIRE(std::is_move_assignable<decltype(e)>::value);
|
||||
REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e)));
|
||||
REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e)));
|
||||
# if !defined(TL_EXPECTED_GCC49)
|
||||
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
|
||||
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user