summaryrefslogtreecommitdiff
path: root/lib/ktl/include/ktl/iterator.h
blob: 58d92becdc41ad2e24894f6262c18ac7e319d33b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2020 The Fuchsia Authors
//
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT

#ifndef ZIRCON_KERNEL_LIB_KTL_INCLUDE_KTL_ITERATOR_H_
#define ZIRCON_KERNEL_LIB_KTL_INCLUDE_KTL_ITERATOR_H_

#include <iterator>

namespace ktl {

// This includes only the "iterator operations" and "range access" subsets
// of the <iterator> API.  These are useful for treating all sorts of
// container types, raw arrays, pointers, and {...} literal lists uniformly.
// It leaves out iterator_traits and the "iterator adaptors" subset, which
// have not yet seemed desirable to employ in kernel code.

using std::advance;
using std::begin;
using std::cbegin;
using std::cend;
using std::crbegin;
using std::crend;
using std::data;
using std::distance;
using std::empty;
using std::end;
using std::next;
using std::prev;
using std::rbegin;
using std::rend;
using std::size;

}  // namespace ktl

#endif  // ZIRCON_KERNEL_LIB_KTL_INCLUDE_KTL_ITERATOR_H_