Skip to content

Commit

Permalink
Use std::begin/std::end to detect iterables instead of member functio…
Browse files Browse the repository at this point in the history
…ns .begin/.end
  • Loading branch information
DavidAce committed Oct 3, 2020
1 parent 39b4067 commit 14ce0b8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions h5pp/include/h5pp/details/h5ppTypeSfinae.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ namespace h5pp::type::sfinae {
template<typename T, typename = std::void_t<>>
struct is_iterable : public std::false_type {};
template<typename T>
struct is_iterable<T, std::void_t<decltype(std::declval<T>().begin()), decltype(std::declval<T>().end()), typename T::value_type>>
: public std::true_type {};
struct is_iterable<T, std::void_t<decltype(std::begin(std::declval<T>())),decltype(std::end(std::declval<T>()))>> : public std::true_type {};
template<typename T>
inline constexpr bool is_iterable_v = is_iterable<T>::value;

Expand Down

0 comments on commit 14ce0b8

Please sign in to comment.