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
b9416a26
Commit
b9416a26
authored
May 27, 2020
by
Francois Chabot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct ADL lookup of arrays on Mac and Windows
parent
f1969e60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
42 deletions
+8
-42
input_adapters.hpp
include/nlohmann/detail/input/input_adapters.hpp
+4
-21
json.hpp
single_include/nlohmann/json.hpp
+4
-21
No files found.
include/nlohmann/detail/input/input_adapters.hpp
View file @
b9416a26
...
...
@@ -365,6 +365,10 @@ typename iterator_input_adapter_factory<IteratorType>::adapter_type input_adapte
template
<
typename
ContainerType
>
auto
input_adapter
(
const
ContainerType
&
container
)
->
decltype
(
input_adapter
(
begin
(
container
),
end
(
container
)))
{
// Enable ADL
using
std
::
begin
;
using
std
::
end
;
return
input_adapter
(
begin
(
container
),
end
(
container
));
}
...
...
@@ -416,15 +420,6 @@ class span_input_adapter
span_input_adapter
(
CharT
b
,
std
::
size_t
l
)
:
ia
(
reinterpret_cast
<
const
char
*>
(
b
),
reinterpret_cast
<
const
char
*>
(
b
)
+
l
)
{}
template
<
typename
CharT
,
typename
std
::
enable_if
<
std
::
is_pointer
<
CharT
>::
value
and
std
::
is_integral
<
typename
std
::
remove_pointer
<
CharT
>::
type
>::
value
and
sizeof
(
typename
std
::
remove_pointer
<
CharT
>::
type
)
==
1
,
int
>::
type
=
0
>
span_input_adapter
(
CharT
b
)
:
span_input_adapter
(
b
,
std
::
strlen
(
reinterpret_cast
<
const
char
*>
(
b
)))
{}
template
<
class
IteratorType
,
typename
std
::
enable_if
<
std
::
is_same
<
typename
iterator_traits
<
IteratorType
>::
iterator_category
,
std
::
random_access_iterator_tag
>::
value
,
...
...
@@ -432,18 +427,6 @@ class span_input_adapter
span_input_adapter
(
IteratorType
first
,
IteratorType
last
)
:
ia
(
input_adapter
(
first
,
last
))
{}
template
<
class
T
,
std
::
size_t
N
>
span_input_adapter
(
T
(
&
array
)[
N
])
:
span_input_adapter
(
std
::
begin
(
array
),
std
::
end
(
array
))
{}
/// input adapter for contiguous container
template
<
class
ContiguousContainer
,
typename
std
::
enable_if
<
not
std
::
is_pointer
<
ContiguousContainer
>::
value
and
std
::
is_base_of
<
std
::
random_access_iterator_tag
,
typename
iterator_traits
<
decltype
(
std
::
begin
(
std
::
declval
<
ContiguousContainer
const
>
()))
>::
iterator_category
>::
value
,
int
>::
type
=
0
>
span_input_adapter
(
const
ContiguousContainer
&
c
)
:
span_input_adapter
(
std
::
begin
(
c
),
std
::
end
(
c
))
{}
contiguous_bytes_input_adapter
&&
get
()
{
return
std
::
move
(
ia
);
...
...
single_include/nlohmann/json.hpp
View file @
b9416a26
...
...
@@ -4787,6 +4787,10 @@ typename iterator_input_adapter_factory<IteratorType>::adapter_type input_adapte
template
<
typename
ContainerType
>
auto
input_adapter
(
const
ContainerType
&
container
)
->
decltype
(
input_adapter
(
begin
(
container
),
end
(
container
)))
{
// Enable ADL
using
std
::
begin
;
using
std
::
end
;
return
input_adapter
(
begin
(
container
),
end
(
container
));
}
...
...
@@ -4838,15 +4842,6 @@ class span_input_adapter
span_input_adapter
(
CharT
b
,
std
::
size_t
l
)
:
ia
(
reinterpret_cast
<
const
char
*>
(
b
),
reinterpret_cast
<
const
char
*>
(
b
)
+
l
)
{}
template
<
typename
CharT
,
typename
std
::
enable_if
<
std
::
is_pointer
<
CharT
>::
value
and
std
::
is_integral
<
typename
std
::
remove_pointer
<
CharT
>::
type
>::
value
and
sizeof
(
typename
std
::
remove_pointer
<
CharT
>::
type
)
==
1
,
int
>::
type
=
0
>
span_input_adapter
(
CharT
b
)
:
span_input_adapter
(
b
,
std
::
strlen
(
reinterpret_cast
<
const
char
*>
(
b
)))
{}
template
<
class
IteratorType
,
typename
std
::
enable_if
<
std
::
is_same
<
typename
iterator_traits
<
IteratorType
>::
iterator_category
,
std
::
random_access_iterator_tag
>::
value
,
...
...
@@ -4854,18 +4849,6 @@ class span_input_adapter
span_input_adapter
(
IteratorType
first
,
IteratorType
last
)
:
ia
(
input_adapter
(
first
,
last
))
{}
template
<
class
T
,
std
::
size_t
N
>
span_input_adapter
(
T
(
&
array
)[
N
])
:
span_input_adapter
(
std
::
begin
(
array
),
std
::
end
(
array
))
{}
/// input adapter for contiguous container
template
<
class
ContiguousContainer
,
typename
std
::
enable_if
<
not
std
::
is_pointer
<
ContiguousContainer
>::
value
and
std
::
is_base_of
<
std
::
random_access_iterator_tag
,
typename
iterator_traits
<
decltype
(
std
::
begin
(
std
::
declval
<
ContiguousContainer
const
>
()))
>::
iterator_category
>::
value
,
int
>::
type
=
0
>
span_input_adapter
(
const
ContiguousContainer
&
c
)
:
span_input_adapter
(
std
::
begin
(
c
),
std
::
end
(
c
))
{}
contiguous_bytes_input_adapter
&&
get
()
{
return
std
::
move
(
ia
);
...
...
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