Skip to content

Commit 25abc60

Browse files
authored
Replace is_bounded_array implementation with std:: one (#13856)
1 parent 92166c6 commit 25abc60

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

Framework/Core/include/Framework/TableBuilder.h

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -569,21 +569,6 @@ constexpr auto tuple_to_pack(std::tuple<ARGS...>&&)
569569
return framework::pack<ARGS...>{};
570570
}
571571

572-
/// Detect if this is a fixed size array
573-
/// FIXME: Notice that C++20 provides a method with the same name
574-
/// so we should move to it when we switch.
575-
template <class T>
576-
struct is_bounded_array : std::false_type {
577-
};
578-
579-
template <class T, std::size_t N>
580-
struct is_bounded_array<T[N]> : std::true_type {
581-
};
582-
583-
template <class T, std::size_t N>
584-
struct is_bounded_array<std::array<T, N>> : std::true_type {
585-
};
586-
587572
template <typename T>
588573
concept BulkInsertable = (std::integral<std::decay<T>> && !std::same_as<bool, std::decay_t<T>>);
589574

@@ -681,14 +666,14 @@ class TableBuilder
681666
{
682667
using args_pack_t = framework::pack<ARGS...>;
683668
if constexpr (sizeof...(ARGS) == 1 &&
684-
is_bounded_array<pack_element_t<0, args_pack_t>>::value == false &&
669+
std::is_bounded_array<pack_element_t<0, args_pack_t>>::value == false &&
685670
std::is_arithmetic_v<pack_element_t<0, args_pack_t>> == false &&
686671
framework::is_base_of_template_v<std::vector, pack_element_t<0, args_pack_t>> == false) {
687672
using objType_t = pack_element_t<0, framework::pack<ARGS...>>;
688673
using argsPack_t = decltype(tuple_to_pack(framework::to_tuple(std::declval<objType_t>())));
689674
return framework::pack_size(argsPack_t{});
690675
} else if constexpr (sizeof...(ARGS) == 1 &&
691-
(is_bounded_array<pack_element_t<0, args_pack_t>>::value == true ||
676+
(std::is_bounded_array<pack_element_t<0, args_pack_t>>::value == true ||
692677
framework::is_base_of_template_v<std::vector, pack_element_t<0, args_pack_t>> == true)) {
693678
using objType_t = pack_element_t<0, framework::pack<ARGS...>>;
694679
using argsPack_t = framework::pack<objType_t>;
@@ -719,7 +704,7 @@ class TableBuilder
719704
{
720705
using args_pack_t = framework::pack<ARGS...>;
721706
if constexpr (sizeof...(ARGS) == 1 &&
722-
is_bounded_array<pack_element_t<0, args_pack_t>>::value == false &&
707+
std::is_bounded_array<pack_element_t<0, args_pack_t>>::value == false &&
723708
std::is_arithmetic_v<pack_element_t<0, args_pack_t>> == false &&
724709
framework::is_base_of_template_v<std::vector, pack_element_t<0, args_pack_t>> == false) {
725710
using objType_t = pack_element_t<0, framework::pack<ARGS...>>;
@@ -730,7 +715,7 @@ class TableBuilder
730715
persister(slot, t);
731716
};
732717
} else if constexpr (sizeof...(ARGS) == 1 &&
733-
(is_bounded_array<pack_element_t<0, args_pack_t>>::value == true ||
718+
(std::is_bounded_array<pack_element_t<0, args_pack_t>>::value == true ||
734719
framework::is_base_of_template_v<std::vector, pack_element_t<0, args_pack_t>> == true)) {
735720
using objType_t = pack_element_t<0, framework::pack<ARGS...>>;
736721
auto persister = persistTuple(framework::pack<objType_t>{}, columnNames);

0 commit comments

Comments
 (0)