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
3c60a66c
Unverified
Commit
3c60a66c
authored
May 26, 2020
by
Niels Lohmann
Committed by
GitHub
May 26, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2104 from dota17/issue#2086
Fix issue#2086: disallow json::value_t type parameter in value()
parents
27fe50dc
cdf5327a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
include/nlohmann/json.hpp
include/nlohmann/json.hpp
+2
-1
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+2
-1
No files found.
include/nlohmann/json.hpp
View file @
3c60a66c
...
@@ -3768,7 +3768,8 @@ class basic_json
...
@@ -3768,7 +3768,8 @@ class basic_json
@since version 1.0.0
@since version 1.0.0
*/
*/
template
<
class
ValueType
,
typename
std
::
enable_if
<
template
<
class
ValueType
,
typename
std
::
enable_if
<
std
::
is_convertible
<
basic_json_t
,
ValueType
>
::
value
,
int
>::
type
=
0
>
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
,
const
ValueType
&
default_value
)
const
{
{
// at only works for objects
// at only works for objects
...
...
single_include/nlohmann/json.hpp
View file @
3c60a66c
...
@@ -19560,7 +19560,8 @@ class basic_json
...
@@ -19560,7 +19560,8 @@ class basic_json
@since version 1.0.0
@since version 1.0.0
*/
*/
template
<
class
ValueType
,
typename
std
::
enable_if
<
template
<
class
ValueType
,
typename
std
::
enable_if
<
std
::
is_convertible
<
basic_json_t
,
ValueType
>
::
value
,
int
>::
type
=
0
>
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
,
const
ValueType
&
default_value
)
const
{
{
// at only works for objects
// at only works for objects
...
...
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