async_mqtt 5.0.0
Loading...
Searching...
No Matches
is_iterator.hpp
1// Copyright Takatoshi Kondo 2022
2//
3// Distributed under the Boost Software License, Version 1.0.
4// (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7#if !defined(ASYNC_MQTT_UTIL_IS_ITERATOR_HPP)
8#define ASYNC_MQTT_UTIL_IS_ITERATOR_HPP
9
10#include <type_traits>
11namespace async_mqtt {
12
13template <typename...>
14using void_t = void;
15
16template <typename T, typename = void>
17struct is_input_iterator : std::false_type {
18};
19
20template <typename T>
21struct is_input_iterator<
22 T,
23 void_t<decltype(++std::declval<T&>()), // incrementable,
24 decltype(*std::declval<T&>()), // dereferencable,
25 decltype(std::declval<T&>() == std::declval<T&>())>> // comparable
26 : std::true_type {};
27
28} // namespace async_mqtt
29
30#endif // ASYNC_MQTT_UTIL_IS_ITERATOR_HPP