Rename type trait macros

This commit is contained in:
Simon Brand
2018-01-14 07:37:23 +00:00
parent 3adfec7ffc
commit af06714a56
3 changed files with 29 additions and 29 deletions

View File

@@ -132,8 +132,8 @@ TEST_CASE("Deletion", "[bases.deletion]") {
REQUIRE(std::is_move_constructible<decltype(e)>::value); REQUIRE(std::is_move_constructible<decltype(e)>::value);
REQUIRE(std::is_copy_assignable<decltype(e)>::value); REQUIRE(std::is_copy_assignable<decltype(e)>::value);
REQUIRE(std::is_move_assignable<decltype(e)>::value); REQUIRE(std::is_move_assignable<decltype(e)>::value);
REQUIRE(IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value); REQUIRE(TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value);
REQUIRE(IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value); REQUIRE(TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value);
# if !defined(TL_EXPECTED_GCC49) # if !defined(TL_EXPECTED_GCC49)
REQUIRE(std::is_trivially_move_constructible<decltype(e)>::value); REQUIRE(std::is_trivially_move_constructible<decltype(e)>::value);
REQUIRE(std::is_trivially_move_assignable<decltype(e)>::value); REQUIRE(std::is_trivially_move_assignable<decltype(e)>::value);
@@ -147,8 +147,8 @@ TEST_CASE("Deletion", "[bases.deletion]") {
REQUIRE(std::is_move_constructible<decltype(e)>::value); REQUIRE(std::is_move_constructible<decltype(e)>::value);
REQUIRE(std::is_copy_assignable<decltype(e)>::value); REQUIRE(std::is_copy_assignable<decltype(e)>::value);
REQUIRE(std::is_move_assignable<decltype(e)>::value); REQUIRE(std::is_move_assignable<decltype(e)>::value);
REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value);
REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value);
# if !defined(TL_EXPECTED_GCC49) # if !defined(TL_EXPECTED_GCC49)
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value); REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value); REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);
@@ -162,8 +162,8 @@ TEST_CASE("Deletion", "[bases.deletion]") {
REQUIRE(std::is_move_constructible<decltype(e)>::value); REQUIRE(std::is_move_constructible<decltype(e)>::value);
REQUIRE(std::is_copy_assignable<decltype(e)>::value); REQUIRE(std::is_copy_assignable<decltype(e)>::value);
REQUIRE(std::is_move_assignable<decltype(e)>::value); REQUIRE(std::is_move_assignable<decltype(e)>::value);
REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value);
REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value);
# if !defined(TL_EXPECTED_GCC49) # if !defined(TL_EXPECTED_GCC49)
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value); REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value); REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);
@@ -177,8 +177,8 @@ TEST_CASE("Deletion", "[bases.deletion]") {
REQUIRE(std::is_move_constructible<decltype(e)>::value); REQUIRE(std::is_move_constructible<decltype(e)>::value);
REQUIRE(std::is_copy_assignable<decltype(e)>::value); REQUIRE(std::is_copy_assignable<decltype(e)>::value);
REQUIRE(std::is_move_assignable<decltype(e)>::value); REQUIRE(std::is_move_assignable<decltype(e)>::value);
REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value);
REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value);
# if !defined(TL_EXPECTED_GCC49) # if !defined(TL_EXPECTED_GCC49)
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value); REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value); REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);

View File

@@ -68,8 +68,8 @@ TEST_CASE("Constructors", "[constructors]") {
REQUIRE(std::is_move_constructible<decltype(e)>::value); REQUIRE(std::is_move_constructible<decltype(e)>::value);
REQUIRE(std::is_copy_assignable<decltype(e)>::value); REQUIRE(std::is_copy_assignable<decltype(e)>::value);
REQUIRE(std::is_move_assignable<decltype(e)>::value); REQUIRE(std::is_move_assignable<decltype(e)>::value);
REQUIRE(IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value); REQUIRE(TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value);
REQUIRE(IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value); REQUIRE(TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value);
# if !defined(TL_EXPECTED_GCC49) # if !defined(TL_EXPECTED_GCC49)
REQUIRE(std::is_trivially_move_constructible<decltype(e)>::value); REQUIRE(std::is_trivially_move_constructible<decltype(e)>::value);
REQUIRE(std::is_trivially_move_assignable<decltype(e)>::value); REQUIRE(std::is_trivially_move_assignable<decltype(e)>::value);
@@ -83,8 +83,8 @@ TEST_CASE("Constructors", "[constructors]") {
REQUIRE(std::is_move_constructible<decltype(e)>::value); REQUIRE(std::is_move_constructible<decltype(e)>::value);
REQUIRE(std::is_copy_assignable<decltype(e)>::value); REQUIRE(std::is_copy_assignable<decltype(e)>::value);
REQUIRE(std::is_move_assignable<decltype(e)>::value); REQUIRE(std::is_move_assignable<decltype(e)>::value);
REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value);
REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value);
# if !defined(TL_EXPECTED_GCC49) # if !defined(TL_EXPECTED_GCC49)
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value); REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value); REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);
@@ -98,8 +98,8 @@ TEST_CASE("Constructors", "[constructors]") {
REQUIRE(std::is_move_constructible<decltype(e)>::value); REQUIRE(std::is_move_constructible<decltype(e)>::value);
REQUIRE(std::is_copy_assignable<decltype(e)>::value); REQUIRE(std::is_copy_assignable<decltype(e)>::value);
REQUIRE(std::is_move_assignable<decltype(e)>::value); REQUIRE(std::is_move_assignable<decltype(e)>::value);
REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value);
REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value);
# if !defined(TL_EXPECTED_GCC49) # if !defined(TL_EXPECTED_GCC49)
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value); REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value); REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);
@@ -113,8 +113,8 @@ TEST_CASE("Constructors", "[constructors]") {
REQUIRE(std::is_move_constructible<decltype(e)>::value); REQUIRE(std::is_move_constructible<decltype(e)>::value);
REQUIRE(std::is_copy_assignable<decltype(e)>::value); REQUIRE(std::is_copy_assignable<decltype(e)>::value);
REQUIRE(std::is_move_assignable<decltype(e)>::value); REQUIRE(std::is_move_assignable<decltype(e)>::value);
REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))::value);
REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value); REQUIRE(!TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))::value);
# if !defined(TL_EXPECTED_GCC49) # if !defined(TL_EXPECTED_GCC49)
REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value); REQUIRE(!std::is_trivially_move_constructible<decltype(e)>::value);
REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value); REQUIRE(!std::is_trivially_move_assignable<decltype(e)>::value);

View File

@@ -50,23 +50,23 @@
// GCC < 5 doesn't support some standard C++11 type traits // GCC < 5 doesn't support some standard C++11 type traits
/// \exclude /// \exclude
#define IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ #define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
std::has_trivial_copy_constructor<T> std::has_trivial_copy_constructor<T>
/// \exclude /// \exclude
#define IS_TRIVIALLY_COPY_ASSIGNABLE(T) std::has_trivial_copy_assign<T> #define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) std::has_trivial_copy_assign<T>
// This one will be different for GCC 5.7 if it's ever supported // This one will be different for GCC 5.7 if it's ever supported
/// \exclude /// \exclude
#define IS_TRIVIALLY_DESTRUCTIBLE(T) std::is_trivially_destructible<T> #define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) std::is_trivially_destructible<T>
#else #else
/// \exclude /// \exclude
#define IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ #define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \
std::is_trivially_copy_constructible<T> std::is_trivially_copy_constructible<T>
/// \exclude /// \exclude
#define IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ #define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \
std::is_trivially_copy_assignable<T> std::is_trivially_copy_assignable<T>
/// \exclude /// \exclude
#define IS_TRIVIALLY_DESTRUCTIBLE(T) std::is_trivially_destructible<T> #define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) std::is_trivially_destructible<T>
#endif #endif
#if __cplusplus > 201103L #if __cplusplus > 201103L
@@ -735,8 +735,8 @@ struct expected_operations_base<void,E> : expected_storage_base<void, E> {
// This class manages conditionally having a trivial copy constructor // This class manages conditionally having a trivial copy constructor
// This specialization is for when T and E are trivially copy constructible // This specialization is for when T and E are trivially copy constructible
template <class T, class E, template <class T, class E,
bool = is_void_or<T,IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T)>::value && bool = is_void_or<T,TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T)>::value &&
IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value> TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value>
struct expected_copy_base : expected_operations_base<T, E> { struct expected_copy_base : expected_operations_base<T, E> {
using expected_operations_base<T, E>::expected_operations_base; using expected_operations_base<T, E>::expected_operations_base;
}; };
@@ -800,11 +800,11 @@ struct expected_move_base<T, E, false> : expected_copy_base<T, E> {
template < template <
class T, class E, class T, class E,
bool = is_void_or<T, bool = is_void_or<T,
conjunction<IS_TRIVIALLY_COPY_ASSIGNABLE(T), conjunction<TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T),
IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T), TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T),
IS_TRIVIALLY_DESTRUCTIBLE(T)>>::value && TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T)>>::value &&
IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value && TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value &&
IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value && IS_TRIVIALLY_DESTRUCTIBLE(E)::value> TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value && TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(E)::value>
struct expected_copy_assign_base : expected_move_base<T, E> { struct expected_copy_assign_base : expected_move_base<T, E> {
using expected_move_base<T, E>::expected_move_base; using expected_move_base<T, E>::expected_move_base;
}; };