Skip to content

Commit 228b4c1

Browse files
alfCcorreaa
authored andcommitted
remove has shape and extensions_of
1 parent 7487565 commit 228b4c1

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

include/boost/multi/utility.hpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,6 @@ auto extents(Container const& cont) {
538538
}
539539
}
540540

541-
template<class T> struct has_shape : decltype(has_shape_aux(std::declval<T>())){}; // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg,cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay) trick
542-
543541
template<class T, typename = decltype(std::declval<T const&>().elements())>
544542
auto has_elements_aux(T const&) -> std::true_type;
545543
inline auto has_elements_aux(...) -> std::false_type;
@@ -571,16 +569,6 @@ constexpr auto extensions_aux2(BoostMultiArray const& arr, std::index_sequence<I
571569
);
572570
}
573571

574-
template<class Element, class T, std::enable_if_t<has_extents<T>::value, int> = 0> // NOLINT(modernize-use-constraints) TODO(correaa) in C++20
575-
[[nodiscard]] auto extents_of(T const& array) {
576-
if constexpr(std::is_convertible_v<T const&, Element>) {
577-
return boost::multi::extents_t<0>{};
578-
}
579-
if constexpr(std::is_convertible_v<typename T::reference, Element>) {
580-
return boost::multi::extents_t<1>{array.extents()};
581-
}
582-
}
583-
584572
template<class Arr2D>
585573
auto transposed(Arr2D&& arr)
586574
-> decltype(std::forward<Arr2D>(arr).transposed()) {
@@ -613,18 +601,6 @@ auto extents(T const& array) {
613601
return extensions_aux<D>::call(array);
614602
}
615603

616-
template<class T1> struct extensions_t_aux;
617-
618-
template<class T1, class T2> auto extensions_me(T2 const& array) {
619-
return extensions_t_aux<T1>::call(array);
620-
}
621-
622-
template<class T1> struct extension_t_aux {
623-
static auto call(T1 const& /*unused*/) { return std::make_tuple(); }
624-
template<class T2>
625-
static auto call(T2 const& array) { return tuple_cat(std::make_tuple(array.extent()), extensions_me<T1>(*begin(array))); }
626-
};
627-
628604
template<class T, typename = decltype(std::declval<T const&>().layout())>
629605
auto has_layout_member_aux(T const&) -> std::true_type;
630606
inline auto has_layout_member_aux(...) -> std::false_type;

0 commit comments

Comments
 (0)