FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/cpp/ql/test/include/iterator.h at codeql-cli-2.11.3 · github/codeql · GitHub
github
/
codeql
Public
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
10.1k
Code
Issues
1k
Pull requests
468
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
cpp
/
ql
/
test
/
include
/
iterator.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
97 lines (84 loc) · 2.96 KB
Breadcrumbs
codeql
/
cpp
/
ql
/
test
/
include
/
iterator.h
Copy path
File metadata and controls
97 lines (84 loc) · 2.96 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#
if
!defined(CODEQL_ITERATOR_H)
#
define
CODEQL_ITERATOR_H
typedef
unsigned
long
size_t
;
#
include
"
type_traits.h
"
namespace
std
{
struct
ptrdiff_t
;
template
<
class
I
>
struct
iterator_traits
;
template
<
class
Category
,
class
value_type
,
class
difference_type
=
ptrdiff_t
,
class
pointer_type
= value_type*,
class
reference_type
= value_type&>
struct
iterator
{
typedef
Category iterator_category;
iterator
();
iterator
(iterator<Category,
remove_const_t
<value_type> >
const
&other);
//
non-const -> const conversion constructor
iterator &
operator
++();
iterator
operator
++(
int
);
iterator &
operator
--();
iterator
operator
--(
int
);
bool
operator
==(iterator other)
const
;
bool
operator
!=(iterator other)
const
;
reference_type
operator
*()
const
;
pointer_type
operator
->()
const
;
iterator
operator
+(
int
);
iterator
operator
-(
int
);
iterator &
operator
+=(
int
);
iterator &
operator
-=(
int
);
int
operator
-(iterator);
reference_type
operator
[](
int
);
};
struct
input_iterator_tag
{};
struct
forward_iterator_tag
:
public
input_iterator_tag
{};
struct
bidirectional_iterator_tag
:
public
forward_iterator_tag
{};
struct
random_access_iterator_tag
:
public
bidirectional_iterator_tag
{};
struct
output_iterator_tag
{};
template
<
class
Container
>
class
back_insert_iterator
{
protected:
Container* container =
nullptr
;
public:
using
iterator_category = output_iterator_tag;
using
value_type =
void
;
using
difference_type =
ptrdiff_t
;
using
pointer =
void
;
using
reference =
void
;
using
container_type = Container;
constexpr
back_insert_iterator
()
noexcept
= default;
constexpr
explicit
back_insert_iterator
(Container& x);
back_insert_iterator&
operator
=(
const
typename
Container::value_type& value);
back_insert_iterator&
operator
=(
typename
Container::value_type&& value);
back_insert_iterator&
operator
*();
back_insert_iterator&
operator
++();
back_insert_iterator
operator
++(
int
);
};
template
<
class
Container
>
constexpr
back_insert_iterator<Container>
back_inserter
(Container& x) {
return
back_insert_iterator<Container>(x);
}
template
<
class
Container
>
class
front_insert_iterator
{
protected:
Container* container =
nullptr
;
public:
using
iterator_category = output_iterator_tag;
using
value_type =
void
;
using
difference_type =
ptrdiff_t
;
using
pointer =
void
;
using
reference =
void
;
using
container_type = Container;
constexpr
front_insert_iterator
()
noexcept
= default;
constexpr
explicit
front_insert_iterator
(Container& x);
constexpr
front_insert_iterator&
operator
=(
const
typename
Container::value_type& value);
constexpr
front_insert_iterator&
operator
=(
typename
Container::value_type&& value);
constexpr
front_insert_iterator&
operator
*();
constexpr
front_insert_iterator&
operator
++();
constexpr
front_insert_iterator
operator
++(
int
);
};
template
<
class
Container
>
constexpr
front_insert_iterator<Container>
front_inserter
(Container& x) {
return
front_insert_iterator<Container>(x);
}
}
#
endif
Back
|
FazBrowse Home
|
New Git URL