[iter] Add hb_iter_of_t<>
This commit is contained in:
parent
b5d6fe1a45
commit
c9d8a07e30
|
@ -48,9 +48,11 @@
|
||||||
* Base classes for iterators.
|
* Base classes for iterators.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
template <typename Item> struct hb_iter_of_t {};
|
||||||
|
|
||||||
/* Base class for all iterators. */
|
/* Base class for all iterators. */
|
||||||
template <typename Iter, typename Item = typename Iter::__item_type__>
|
template <typename Iter, typename Item = typename Iter::__item_type__>
|
||||||
struct hb_iter_t
|
struct hb_iter_t : hb_iter_of_t<Item>
|
||||||
{
|
{
|
||||||
typedef Iter iter_t;
|
typedef Iter iter_t;
|
||||||
typedef Item item_t;
|
typedef Item item_t;
|
||||||
|
@ -161,11 +163,11 @@ struct hb_is_iterable { enum { value = _hb_is_iterable<T, hb_true_t>::value }; }
|
||||||
|
|
||||||
/* hb_is_iterator() / hb_is_sorted_iterator() */
|
/* hb_is_iterator() / hb_is_sorted_iterator() */
|
||||||
|
|
||||||
template<typename Iter = void, typename Item = void> char _hb_is_iterator (...) {};
|
template<typename Item = void> char _hb_is_iterator (...) {};
|
||||||
template<typename Iter, typename Item> int _hb_is_iterator (hb_iter_t<Iter, Item> *) {};
|
template<typename Item> int _hb_is_iterator (hb_iter_of_t<Item> *) {};
|
||||||
template<typename Iter, typename Item> int _hb_is_iterator (hb_iter_t<Iter, const Item> *) {};
|
template<typename Item> int _hb_is_iterator (hb_iter_of_t<const Item> *) {};
|
||||||
template<typename Iter, typename Item> int _hb_is_iterator (hb_iter_t<Iter, Item&> *) {};
|
template<typename Item> int _hb_is_iterator (hb_iter_of_t<Item&> *) {};
|
||||||
template<typename Iter, typename Item> int _hb_is_iterator (hb_iter_t<Iter, const Item&> *) {};
|
template<typename Item> int _hb_is_iterator (hb_iter_of_t<const Item&> *) {};
|
||||||
static_assert (sizeof (char) != sizeof (int), "");
|
static_assert (sizeof (char) != sizeof (int), "");
|
||||||
template<typename Iter, typename Item>
|
template<typename Iter, typename Item>
|
||||||
struct hb_is_iterator { enum {
|
struct hb_is_iterator { enum {
|
||||||
|
|
Loading…
Reference in New Issue