Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
b8aebbc0
Commit
b8aebbc0
authored
Mar 05, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
std::iterator compliance
parent
7fd6146d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
12 deletions
+44
-12
cppa/type_value_pair.hpp
cppa/type_value_pair.hpp
+44
-12
No files found.
cppa/type_value_pair.hpp
View file @
b8aebbc0
...
@@ -31,6 +31,8 @@
...
@@ -31,6 +31,8 @@
#ifndef TYPE_VALUE_PAIR_HPP
#ifndef TYPE_VALUE_PAIR_HPP
#define TYPE_VALUE_PAIR_HPP
#define TYPE_VALUE_PAIR_HPP
#include <cstddef>
#include "cppa/uniform_type_info.hpp"
#include "cppa/uniform_type_info.hpp"
namespace
cppa
{
namespace
cppa
{
...
@@ -44,17 +46,31 @@ class type_value_pair_const_iterator
...
@@ -44,17 +46,31 @@ class type_value_pair_const_iterator
public:
public:
typedef
type_value_pair
const
value_type
;
typedef
std
::
ptrdiff_t
difference_type
;
typedef
type_value_pair
const
*
pointer
;
typedef
type_value_pair
const
&
reference
;
typedef
std
::
bidirectional_iterator_tag
iterator_category
;
constexpr
type_value_pair_const_iterator
()
:
iter
(
nullptr
)
{
}
type_value_pair_const_iterator
(
type_value_pair
const
*
i
)
:
iter
(
i
)
{
}
type_value_pair_const_iterator
(
type_value_pair
const
*
i
)
:
iter
(
i
)
{
}
type_value_pair_const_iterator
(
type_value_pair_const_iterator
const
&
)
=
default
;
type_value_pair_const_iterator
(
type_value_pair_const_iterator
const
&
)
=
default
;
type_value_pair_const_iterator
&
operator
=
(
type_value_pair_const_iterator
const
&
)
=
default
;
inline
uniform_type_info
const
*
type
()
const
{
return
iter
->
first
;
}
inline
uniform_type_info
const
*
type
()
const
{
return
iter
->
first
;
}
inline
void
const
*
value
()
const
{
return
iter
->
second
;
}
inline
void
const
*
value
()
const
{
return
iter
->
second
;
}
inline
decltype
(
iter
)
operator
->
()
{
return
iter
;
}
inline
decltype
(
iter
)
base
()
const
{
return
iter
;
}
inline
decltype
(
iter
)
operator
->
()
const
{
return
iter
;
}
inline
decltype
(
*
iter
)
operator
*
()
{
return
*
iter
;
}
inline
decltype
(
*
iter
)
operator
*
()
const
{
return
*
iter
;
}
inline
type_value_pair_const_iterator
&
operator
++
()
inline
type_value_pair_const_iterator
&
operator
++
()
{
{
...
@@ -62,29 +78,45 @@ class type_value_pair_const_iterator
...
@@ -62,29 +78,45 @@ class type_value_pair_const_iterator
return
*
this
;
return
*
this
;
}
}
inline
type_value_pair_const_iterator
&
operator
--
(
)
inline
type_value_pair_const_iterator
operator
++
(
int
)
{
{
--
iter
;
type_value_pair_const_iterator
tmp
{
*
this
};
return
*
this
;
++
iter
;
return
tmp
;
}
}
inline
type_value_pair_const_iterator
operator
+
(
size_t
offset
)
inline
type_value_pair_const_iterator
&
operator
--
(
)
{
{
return
iter
+
offset
;
--
iter
;
return
*
this
;
}
}
inline
bool
operator
==
(
type_value_pair_const_iterator
const
&
other
)
const
inline
type_value_pair_const_iterator
operator
--
(
int
)
{
{
return
iter
==
other
.
iter
;
type_value_pair_const_iterator
tmp
{
*
this
};
--
iter
;
return
tmp
;
}
}
inline
bool
operator
!=
(
type_value_pair_const_iterator
const
&
other
)
const
inline
type_value_pair_const_iterator
operator
+
(
size_t
offset
)
{
{
return
iter
!=
other
.
iter
;
return
iter
+
offset
;
}
}
};
};
inline
bool
operator
==
(
type_value_pair_const_iterator
const
&
lhs
,
type_value_pair_const_iterator
const
&
rhs
)
{
return
lhs
.
base
()
==
rhs
.
base
();
}
inline
bool
operator
!=
(
type_value_pair_const_iterator
const
&
lhs
,
type_value_pair_const_iterator
const
&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
}
// namespace cppa
}
// namespace cppa
#endif // TYPE_VALUE_PAIR_HPP
#endif // TYPE_VALUE_PAIR_HPP
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment