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
8575fdf9
Unverified
Commit
8575fdf9
authored
Jun 23, 2020
by
Niels Lohmann
Committed by
GitHub
Jun 23, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2181 from dota17/issue#1275
Fix issue#1275
parents
4bfe4add
4a6c68c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
include/nlohmann/json.hpp
include/nlohmann/json.hpp
+6
-6
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+6
-6
No files found.
include/nlohmann/json.hpp
View file @
8575fdf9
...
...
@@ -3770,7 +3770,7 @@ class basic_json
template
<
class
ValueType
,
typename
std
::
enable_if
<
std
::
is_convertible
<
basic_json_t
,
ValueType
>
::
value
and
not
std
::
is_same
<
value_t
,
ValueType
>::
value
,
int
>::
type
=
0
>
ValueType
value
(
const
typename
object_t
::
key_type
&
key
,
const
ValueType
&
default_value
)
const
ValueType
value
(
const
typename
object_t
::
key_type
&
key
,
ValueType
&
&
default_value
)
const
{
// at only works for objects
if
(
JSON_HEDLEY_LIKELY
(
is_object
()))
...
...
@@ -3782,7 +3782,7 @@ class basic_json
return
*
it
;
}
return
default_value
;
return
std
::
move
(
default_value
)
;
}
JSON_THROW
(
type_error
::
create
(
306
,
"cannot use value() with "
+
std
::
string
(
type_name
())));
...
...
@@ -3794,7 +3794,7 @@ class basic_json
*/
string_t
value
(
const
typename
object_t
::
key_type
&
key
,
const
char
*
default_value
)
const
{
return
value
(
key
,
st
ring_t
(
default_value
));
return
value
(
key
,
st
d
::
move
(
string_t
(
default_value
)
));
}
/*!
...
...
@@ -3842,7 +3842,7 @@ class basic_json
*/
template
<
class
ValueType
,
typename
std
::
enable_if
<
std
::
is_convertible
<
basic_json_t
,
ValueType
>
::
value
,
int
>::
type
=
0
>
ValueType
value
(
const
json_pointer
&
ptr
,
const
ValueType
&
default_value
)
const
ValueType
value
(
const
json_pointer
&
ptr
,
ValueType
&
&
default_value
)
const
{
// at only works for objects
if
(
JSON_HEDLEY_LIKELY
(
is_object
()))
...
...
@@ -3854,7 +3854,7 @@ class basic_json
}
JSON_INTERNAL_CATCH
(
out_of_range
&
)
{
return
default_value
;
return
std
::
move
(
default_value
)
;
}
}
...
...
@@ -3868,7 +3868,7 @@ class basic_json
JSON_HEDLEY_NON_NULL
(
3
)
string_t
value
(
const
json_pointer
&
ptr
,
const
char
*
default_value
)
const
{
return
value
(
ptr
,
st
ring_t
(
default_value
));
return
value
(
ptr
,
st
d
::
move
(
string_t
(
default_value
)
));
}
/*!
...
...
single_include/nlohmann/json.hpp
View file @
8575fdf9
...
...
@@ -19575,7 +19575,7 @@ class basic_json
template
<
class
ValueType
,
typename
std
::
enable_if
<
std
::
is_convertible
<
basic_json_t
,
ValueType
>
::
value
and
not
std
::
is_same
<
value_t
,
ValueType
>::
value
,
int
>::
type
=
0
>
ValueType
value
(
const
typename
object_t
::
key_type
&
key
,
const
ValueType
&
default_value
)
const
ValueType
value
(
const
typename
object_t
::
key_type
&
key
,
ValueType
&
&
default_value
)
const
{
// at only works for objects
if
(
JSON_HEDLEY_LIKELY
(
is_object
()))
...
...
@@ -19587,7 +19587,7 @@ class basic_json
return
*
it
;
}
return
default_value
;
return
std
::
move
(
default_value
)
;
}
JSON_THROW
(
type_error
::
create
(
306
,
"cannot use value() with "
+
std
::
string
(
type_name
())));
...
...
@@ -19599,7 +19599,7 @@ class basic_json
*/
string_t
value
(
const
typename
object_t
::
key_type
&
key
,
const
char
*
default_value
)
const
{
return
value
(
key
,
st
ring_t
(
default_value
));
return
value
(
key
,
st
d
::
move
(
string_t
(
default_value
)
));
}
/*!
...
...
@@ -19647,7 +19647,7 @@ class basic_json
*/
template
<
class
ValueType
,
typename
std
::
enable_if
<
std
::
is_convertible
<
basic_json_t
,
ValueType
>
::
value
,
int
>::
type
=
0
>
ValueType
value
(
const
json_pointer
&
ptr
,
const
ValueType
&
default_value
)
const
ValueType
value
(
const
json_pointer
&
ptr
,
ValueType
&
&
default_value
)
const
{
// at only works for objects
if
(
JSON_HEDLEY_LIKELY
(
is_object
()))
...
...
@@ -19659,7 +19659,7 @@ class basic_json
}
JSON_INTERNAL_CATCH
(
out_of_range
&
)
{
return
default_value
;
return
std
::
move
(
default_value
)
;
}
}
...
...
@@ -19673,7 +19673,7 @@ class basic_json
JSON_HEDLEY_NON_NULL
(
3
)
string_t
value
(
const
json_pointer
&
ptr
,
const
char
*
default_value
)
const
{
return
value
(
ptr
,
st
ring_t
(
default_value
));
return
value
(
ptr
,
st
d
::
move
(
string_t
(
default_value
)
));
}
/*!
...
...
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