Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
3e1bd5b8
Unverified
Commit
3e1bd5b8
authored
Mar 01, 2019
by
Joshua Haberman
Committed by
GitHub
Mar 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5014 from Kwizatz/iterator-deprecation-fix
Updating Iterators to be compatible with C++17 in MSVC
parents
f2ef7970
b0f332ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
26 deletions
+10
-26
repeated_field.h
src/google/protobuf/repeated_field.h
+10
-26
No files found.
src/google/protobuf/repeated_field.h
View file @
3e1bd5b8
...
...
@@ -2280,23 +2280,14 @@ namespace internal {
// This code based on net/proto/proto-array-internal.h by Jeffrey Yasskin
// (jyasskin@google.com).
template
<
typename
Element
>
class
RepeatedPtrIterator
:
public
std
::
iterator
<
std
::
random_access_iterator_tag
,
Element
>
{
class
RepeatedPtrIterator
{
public
:
typedef
RepeatedPtrIterator
<
Element
>
iterator
;
typedef
std
::
iterator
<
std
::
random_access_iterator_tag
,
Element
>
superclass
;
// Shadow the value_type in std::iterator<> because const_iterator::value_type
// needs to be T, not const T.
typedef
std
::
random_access_iterator_tag
iterator_category
;
typedef
typename
std
::
remove_const
<
Element
>::
type
value_type
;
// Let the compiler know that these are type names, so we don't have to
// write "typename" in front of them everywhere.
typedef
typename
superclass
::
reference
reference
;
typedef
typename
superclass
::
pointer
pointer
;
typedef
typename
superclass
::
difference_type
difference_type
;
typedef
std
::
ptrdiff_t
difference_type
;
typedef
Element
*
pointer
;
typedef
Element
&
reference
;
RepeatedPtrIterator
()
:
it_
(
NULL
)
{}
explicit
RepeatedPtrIterator
(
void
*
const
*
it
)
:
it_
(
it
)
{}
...
...
@@ -2376,21 +2367,14 @@ class RepeatedPtrIterator
// referenced by the iterator. It should either be "void *" for a mutable
// iterator, or "const void* const" for a constant iterator.
template
<
typename
Element
,
typename
VoidPtr
>
class
RepeatedPtrOverPtrsIterator
:
public
std
::
iterator
<
std
::
random_access_iterator_tag
,
Element
>
{
class
RepeatedPtrOverPtrsIterator
{
public
:
typedef
RepeatedPtrOverPtrsIterator
<
Element
,
VoidPtr
>
iterator
;
typedef
std
::
iterator
<
std
::
random_access_iterator_tag
,
Element
>
superclass
;
// Shadow the value_type in std::iterator<> because const_iterator::value_type
// needs to be T, not const T.
typedef
std
::
random_access_iterator_tag
iterator_category
;
typedef
typename
std
::
remove_const
<
Element
>::
type
value_type
;
// Let the compiler know that these are type names, so we don't have to
// write "typename" in front of them everywhere.
typedef
typename
superclass
::
reference
reference
;
typedef
typename
superclass
::
pointer
pointer
;
typedef
typename
superclass
::
difference_type
difference_type
;
typedef
std
::
ptrdiff_t
difference_type
;
typedef
Element
*
pointer
;
typedef
Element
&
reference
;
RepeatedPtrOverPtrsIterator
()
:
it_
(
NULL
)
{}
explicit
RepeatedPtrOverPtrsIterator
(
VoidPtr
*
it
)
:
it_
(
it
)
{}
...
...
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