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
27d0dfc1
Commit
27d0dfc1
authored
Oct 30, 2019
by
Anthony Van Herrewege
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1647: non-member operator== breaks enum (de)serialization.
parent
f272ad53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
json.hpp
include/nlohmann/json.hpp
+3
-3
json.hpp
single_include/nlohmann/json.hpp
+2
-2
No files found.
include/nlohmann/json.hpp
View file @
27d0dfc1
...
@@ -2633,11 +2633,11 @@ class basic_json
...
@@ -2633,11 +2633,11 @@ class basic_json
detail
::
has_non_default_from_json
<
basic_json_t
,
ValueType
>::
value
,
detail
::
has_non_default_from_json
<
basic_json_t
,
ValueType
>::
value
,
int
>
=
0
>
int
>
=
0
>
ValueType
get
()
const
noexcept
(
noexcept
(
ValueType
get
()
const
noexcept
(
noexcept
(
JSONSerializer
<
ValueType
CV
>::
from_json
(
std
::
declval
<
const
basic_json_t
&>
())))
JSONSerializer
<
ValueType
>::
from_json
(
std
::
declval
<
const
basic_json_t
&>
())))
{
{
static_assert
(
not
std
::
is_reference
<
ValueTypeCV
>::
value
,
static_assert
(
not
std
::
is_reference
<
ValueTypeCV
>::
value
,
"get() cannot be used with reference types, you might want to use get_ref()"
);
"get() cannot be used with reference types, you might want to use get_ref()"
);
return
JSONSerializer
<
ValueType
CV
>::
from_json
(
*
this
);
return
JSONSerializer
<
ValueType
>::
from_json
(
*
this
);
}
}
/*!
/*!
...
@@ -8062,7 +8062,7 @@ struct hash<nlohmann::json>
...
@@ -8062,7 +8062,7 @@ struct hash<nlohmann::json>
/// @note: do not remove the space after '<',
/// @note: do not remove the space after '<',
/// see https://github.com/nlohmann/json/pull/679
/// see https://github.com/nlohmann/json/pull/679
template
<>
template
<>
struct
less
<
::
nlohmann
::
detail
::
value_t
>
struct
less
<::
nlohmann
::
detail
::
value_t
>
{
{
/*!
/*!
@brief compare two value_t enum values
@brief compare two value_t enum values
...
...
single_include/nlohmann/json.hpp
View file @
27d0dfc1
...
@@ -17163,11 +17163,11 @@ class basic_json
...
@@ -17163,11 +17163,11 @@ class basic_json
detail
::
has_non_default_from_json
<
basic_json_t
,
ValueType
>::
value
,
detail
::
has_non_default_from_json
<
basic_json_t
,
ValueType
>::
value
,
int
>
=
0
>
int
>
=
0
>
ValueType
get
()
const
noexcept
(
noexcept
(
ValueType
get
()
const
noexcept
(
noexcept
(
JSONSerializer
<
ValueType
CV
>::
from_json
(
std
::
declval
<
const
basic_json_t
&>
())))
JSONSerializer
<
ValueType
>::
from_json
(
std
::
declval
<
const
basic_json_t
&>
())))
{
{
static_assert
(
not
std
::
is_reference
<
ValueTypeCV
>::
value
,
static_assert
(
not
std
::
is_reference
<
ValueTypeCV
>::
value
,
"get() cannot be used with reference types, you might want to use get_ref()"
);
"get() cannot be used with reference types, you might want to use get_ref()"
);
return
JSONSerializer
<
ValueType
CV
>::
from_json
(
*
this
);
return
JSONSerializer
<
ValueType
>::
from_json
(
*
this
);
}
}
/*!
/*!
...
...
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