diff --git a/tiledb/sm/cpp_api/type.h b/tiledb/sm/cpp_api/type.h index d2db4c9e1ce..2642837fe42 100644 --- a/tiledb/sm/cpp_api/type.h +++ b/tiledb/sm/cpp_api/type.h @@ -7,7 +7,7 @@ * * The MIT License * - * @copyright Copyright (c) 2017-2021 TileDB, Inc. + * @copyright Copyright (c) 2017-2023 TileDB, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,8 +47,6 @@ #include #include -#define IS_TRIVIALLY_COPYABLE(T) std::is_trivially_copyable::value - namespace tiledb { namespace impl { @@ -59,15 +57,15 @@ struct defer_assert : std::false_type {}; /** Used to statically type check for std::array. */ template -struct is_stl_array : std::false_type {}; +struct is_std_array : std::false_type {}; template -struct is_stl_array> : std::true_type {}; +struct is_std_array> : std::true_type {}; /** SFINAE handler for types that make sense to be bitwise copied. **/ template using enable_trivial = typename std::enable_if< - IS_TRIVIALLY_COPYABLE(T) && !std::is_pointer::value && - !std::is_array::value && !is_stl_array::value>::type; + std::is_trivially_copyable_v && !std::is_pointer_v && + !std::is_array_v && !is_std_array::value>::type; /** * Convert a type into a tiledb_datatype_t. The default for all @@ -75,7 +73,8 @@ using enable_trivial = typename std::enable_if< */ template struct type_to_tiledb { - static_assert(IS_TRIVIALLY_COPYABLE(T), "Type must be trivially copyable."); + static_assert( + std::is_trivially_copyable_v, "Type must be trivially copyable."); using type = char; static const tiledb_datatype_t tiledb_type = TILEDB_STRING_ASCII; static constexpr const char* name = "Trivially Copyable (CHAR)";