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
9f8b270e
Commit
9f8b270e
authored
Jan 22, 2017
by
Théo DELRIEU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some warnings
parent
9c6ef74a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
+4
-6
src/json.hpp
src/json.hpp
+1
-3
src/json.hpp.re2c
src/json.hpp.re2c
+1
-1
test/src/unit-udt.cpp
test/src/unit-udt.cpp
+2
-2
No files found.
src/json.hpp
View file @
9f8b270e
...
...
@@ -372,7 +372,7 @@ contains a `mapped_type`, whereas `std::vector` fails the test.
public: \
static constexpr bool value = \
std::is_integral<decltype(detect(std::declval<T>()))>::value; \
}
;
}
NLOHMANN_JSON_HAS_HELPER
(
mapped_type
);
NLOHMANN_JSON_HAS_HELPER
(
key_type
);
...
...
@@ -3113,7 +3113,6 @@ class basic_json
// we cannot static_assert on T being non-const, because there is support
// for get<const basic_json_t>(), which is why we still need the uncvref
static_assert
(
not
std
::
is_reference
<
T
>::
value
,
"get cannot be used with reference types, you might want to use get_ref"
);
static_assert
(
not
std
::
is_pointer
<
T
>::
value
,
"get cannot be used with pointer types, you might want to use get_ptr"
);
static_assert
(
std
::
is_default_constructible
<
U
>::
value
,
"Types must be DefaultConstructible when used with get"
);
U
ret
;
...
...
@@ -3146,7 +3145,6 @@ class basic_json
U
get
()
const
noexcept
(
noexcept
(
JSONSerializer
<
T
>::
from_json
(
std
::
declval
<
const
basic_json_t
&>
())))
{
static_assert
(
not
std
::
is_reference
<
T
>::
value
,
"get cannot be used with reference types, you might want to use get_ref"
);
static_assert
(
not
std
::
is_pointer
<
T
>::
value
,
"get cannot be used with pointer types, you might want to use get_ptr"
);
return
JSONSerializer
<
T
>::
from_json
(
*
this
);
}
...
...
src/json.hpp.re2c
View file @
9f8b270e
...
...
@@ -372,7 +372,7 @@ contains a `mapped_type`, whereas `std::vector` fails the test.
public: \
static constexpr bool value = \
std::is_integral<decltype(detect(std::declval<T>()))>::value; \
}
;
}
NLOHMANN_JSON_HAS_HELPER(mapped_type);
NLOHMANN_JSON_HAS_HELPER(key_type);
...
...
test/src/unit-udt.cpp
View file @
9f8b270e
...
...
@@ -348,7 +348,7 @@ TEST_CASE("adl_serializer specialization", "[udt]")
json
j
=
optPerson
;
CHECK
(
j
.
is_null
());
optPerson
.
reset
(
new
udt
::
person
{{
42
},
{
"John Doe"
}});
optPerson
.
reset
(
new
udt
::
person
{{
42
},
{
"John Doe"
}
,
udt
::
country
::
russia
});
j
=
optPerson
;
CHECK_FALSE
(
j
.
is_null
());
...
...
@@ -357,7 +357,7 @@ TEST_CASE("adl_serializer specialization", "[udt]")
SECTION
(
"from_json"
)
{
auto
person
=
udt
::
person
{{
42
},
{
"John Doe"
}};
auto
person
=
udt
::
person
{{
42
},
{
"John Doe"
}
,
udt
::
country
::
russia
};
json
j
=
person
;
auto
optPerson
=
j
.
get
<
std
::
shared_ptr
<
udt
::
person
>>
();
...
...
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