Skip to content

Commit

Permalink
handle disabling match for std::vector differently
Browse files Browse the repository at this point in the history
So that it actually works...
  • Loading branch information
germasch committed Jul 3, 2022
1 parent b2abc40 commit b67e874
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions bindings/CXX11/adios2/cxx11/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,22 @@ namespace detail
template <class...>
using void_t = void;

}
} // end namespace detail

template <typename C, typename = void>
struct ndarray_traits : std::false_type
{
};

// disable considering std::vector ndarray-like since it causes ambiguity with
// existing std::vector-based overloads
template <typename T>
struct ndarray_traits<std::vector<T>> : std::false_type
{
};

template <typename C>
struct ndarray_traits<
C, detail::void_t<typename C::value_type, typename C::pointer,
typename C::size_type, decltype(std::declval<C>().data()),
decltype(std::declval<C>().size())>> : std::true_type
decltype(std::declval<C>().size()),
// don't match std::vector since it's handled separately
typename std::enable_if<!std::is_same<
C, std::vector<typename C::value_type>>::type>>>
: std::true_type
{
using value_type = typename C::value_type;
using pointer = typename C::pointer;
Expand Down

0 comments on commit b67e874

Please sign in to comment.