From 0684a389ab568eb29f60413812a828ac81997a43 Mon Sep 17 00:00:00 2001 From: eric-hughes-tiledb <82400964+eric-hughes-tiledb@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:16:10 -0600 Subject: [PATCH] Followup to 4355: eliminate the macro (#4376) The macro changed in #4355 is eliminated here. It was only used in two places, and the new version of the macro added nothing over its replacement text. --- TYPE: NO_HISTORY DESC: Followup to 4355: eliminate the macro --- tiledb/sm/cpp_api/type.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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)";