Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
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
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
Libraries
json
Commits
06939452
Unverified
Commit
06939452
authored
Dec 08, 2017
by
Niels Lohmann
Committed by
GitHub
Dec 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #860 from bogemic/std_iterator_conformance_cpp17
iter_impl template conformance with C++17
parents
7c2d4f18
64d6daa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
src/json.hpp
src/json.hpp
+9
-1
No files found.
src/json.hpp
View file @
06939452
...
@@ -3631,7 +3631,7 @@ This class implements a both iterators (iterator and const_iterator) for the
...
@@ -3631,7 +3631,7 @@ This class implements a both iterators (iterator and const_iterator) for the
iterators in version 3.0.0 (see https://github.com/nlohmann/json/issues/593)
iterators in version 3.0.0 (see https://github.com/nlohmann/json/issues/593)
*/
*/
template
<
typename
BasicJsonType
>
template
<
typename
BasicJsonType
>
class
iter_impl
:
public
std
::
iterator
<
std
::
bidirectional_iterator_tag
,
BasicJsonType
>
class
iter_impl
{
{
/// allow basic_json to access private members
/// allow basic_json to access private members
friend
iter_impl
<
typename
std
::
conditional
<
std
::
is_const
<
BasicJsonType
>::
value
,
typename
std
::
remove_const
<
BasicJsonType
>::
type
,
const
BasicJsonType
>::
type
>
;
friend
iter_impl
<
typename
std
::
conditional
<
std
::
is_const
<
BasicJsonType
>::
value
,
typename
std
::
remove_const
<
BasicJsonType
>::
type
,
const
BasicJsonType
>::
type
>
;
...
@@ -3645,6 +3645,14 @@ class iter_impl : public std::iterator<std::bidirectional_iterator_tag, BasicJso
...
@@ -3645,6 +3645,14 @@ class iter_impl : public std::iterator<std::bidirectional_iterator_tag, BasicJso
"iter_impl only accepts (const) basic_json"
);
"iter_impl only accepts (const) basic_json"
);
public:
public:
/// The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17.
/// The C++ Standard has never required user-defined iterators to derive from std::iterator.
/// A user-defined iterator should provide publicly accessible typedefs named
/// iterator_category, value_type, difference_type, pointer, and reference.
/// Note that value_type is required to be non-const, even for constant iterators.
using
iterator_category
=
std
::
bidirectional_iterator_tag
;
/// the type of the values when the iterator is dereferenced
/// the type of the values when the iterator is dereferenced
using
value_type
=
typename
BasicJsonType
::
value_type
;
using
value_type
=
typename
BasicJsonType
::
value_type
;
/// a type to represent differences between iterators
/// a type to represent differences between iterators
...
...
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