Static Value-Flow Analysis
Loading...
Searching...
No Matches
iterator_range.h
Go to the documentation of this file.
1//===- iter_range.h - A range adaptor for iterators ---------*- C++ -*-===//
2//
3// From the LLVM Project with some modifications, under the Apache License v2.0
4// with LLVM Exceptions. See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
16//===----------------------------------------------------------------------===//
17
18#ifndef UTIL_ITERATOR_RANGE_H
19#define UTIL_ITERATOR_RANGE_H
20
21#include <utility>
22
23namespace SVF
24{
25
30template <typename IteratorT>
32{
34
35public:
36 //TODO: Add SFINAE to test that the Container's iterators match the range's
37 // iterators.
38 template <typename Container>
40 //TODO: Consider ADL/non-member begin/end calls.
45
47 {
48 return begin_iterator;
49 }
50 IteratorT end() const
51 {
52 return end_iterator;
53 }
54 bool empty() const
55 {
57 }
58};
59
64template <class T> iter_range<T> make_range(T x, T y)
65{
66 return iter_range<T>(std::move(x), std::move(y));
67}
68
69template <typename T> iter_range<T> make_range(std::pair<T, T> p)
70{
71 return iter_range<T>(std::move(p.first), std::move(p.second));
72}
73
74}
75
76#endif
cJSON * p
Definition cJSON.cpp:2559
IteratorT begin() const
IteratorT begin_iterator
IteratorT end() const
iter_range(IteratorT begin_iterator, IteratorT end_iterator)
iter_range(Container &&c)
IteratorT end_iterator
bool empty() const
for isBitcode
Definition BasicTypes.h:68
iter_range< T > make_range(T x, T y)
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74