Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
f1080d7c
Commit
f1080d7c
authored
Dec 18, 2018
by
David Avedissian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code review.
parent
2c23f0a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
iterator_traits.hpp
include/nlohmann/detail/iterators/iterator_traits.hpp
+6
-7
json.hpp
single_include/nlohmann/json.hpp
+8
-7
No files found.
include/nlohmann/detail/iterators/iterator_traits.hpp
View file @
f1080d7c
...
@@ -39,11 +39,11 @@ struct iterator_traits<T, enable_if_t<!std::is_pointer<T>::value>>
...
@@ -39,11 +39,11 @@ struct iterator_traits<T, enable_if_t<!std::is_pointer<T>::value>>
template
<
typename
T
>
template
<
typename
T
>
struct
iterator_traits
<
T
*
,
enable_if_t
<
std
::
is_object
<
T
>::
value
>>
{
struct
iterator_traits
<
T
*
,
enable_if_t
<
std
::
is_object
<
T
>::
value
>>
{
typedef
std
::
random_access_iterator_tag
iterator_category
;
using
iterator_category
=
std
::
random_access_iterator_tag
;
typedef
T
value_type
;
using
value_type
=
T
;
typedef
ptrdiff_t
difference_type
;
using
difference_type
=
ptrdiff_t
;
typedef
T
*
pointer
;
using
pointer
=
T
*
;
typedef
T
&
reference
;
using
reference
=
T
&
;
};
};
}
}
}
}
\ No newline at end of file
single_include/nlohmann/json.hpp
View file @
f1080d7c
...
@@ -367,8 +367,8 @@ struct iterator_types <
...
@@ -367,8 +367,8 @@ struct iterator_types <
using
iterator_category
=
typename
It
::
iterator_category
;
using
iterator_category
=
typename
It
::
iterator_category
;
};
};
// This is required
due to https://github.com/nlohmann/json/issues/1341 - where some
// This is required
as some compilers implement std::iterator_traits in a way that
//
compilers implement std::iterator_traits in a way that doesn't work with SFINAE
.
//
doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341
.
template
<
typename
T
,
typename
=
void
>
template
<
typename
T
,
typename
=
void
>
struct
iterator_traits
struct
iterator_traits
{
{
...
@@ -383,14 +383,15 @@ struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
...
@@ -383,14 +383,15 @@ struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
template
<
typename
T
>
template
<
typename
T
>
struct
iterator_traits
<
T
*
,
enable_if_t
<
std
::
is_object
<
T
>::
value
>>
struct
iterator_traits
<
T
*
,
enable_if_t
<
std
::
is_object
<
T
>::
value
>>
{
{
typedef
std
::
random_access_iterator_tag
iterator_category
;
using
iterator_category
=
std
::
random_access_iterator_tag
;
typedef
T
value_type
;
using
value_type
=
T
;
typedef
ptrdiff_t
difference_type
;
using
difference_type
=
ptrdiff_t
;
typedef
T
*
pointer
;
using
pointer
=
T
*
;
typedef
T
&
reference
;
using
reference
=
T
&
;
};
};
}
}
}
}
// #include <nlohmann/detail/meta/cpp_future.hpp>
// #include <nlohmann/detail/meta/cpp_future.hpp>
// #include <nlohmann/detail/meta/detected.hpp>
// #include <nlohmann/detail/meta/detected.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