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
eb30ff06
Unverified
Commit
eb30ff06
authored
Sep 06, 2018
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🚨
fixed a compiler warning #1224
parent
d713727f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
17 deletions
+4
-17
Makefile
Makefile
+4
-1
include/nlohmann/detail/macro_scope.hpp
include/nlohmann/detail/macro_scope.hpp
+0
-2
include/nlohmann/detail/meta/type_traits.hpp
include/nlohmann/detail/meta/type_traits.hpp
+0
-6
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+0
-8
No files found.
Makefile
View file @
eb30ff06
...
@@ -191,7 +191,10 @@ pedantic_gcc:
...
@@ -191,7 +191,10 @@ pedantic_gcc:
-Wunused-macros
\
-Wunused-macros
\
-Wunused-parameter
\
-Wunused-parameter
\
-Wuseless-cast
\
-Wuseless-cast
\
-Wvariadic-macros"
-Wvariadic-macros
\
-Wctor-dtor-privacy
\
-Winit-self
\
-Wstrict-null-sentinel"
##########################################################################
##########################################################################
# benchmarks
# benchmarks
...
...
include/nlohmann/detail/macro_scope.hpp
View file @
eb30ff06
...
@@ -115,11 +115,9 @@ contains a `mapped_type`, whereas `std::vector` fails the test.
...
@@ -115,11 +115,9 @@ contains a `mapped_type`, whereas `std::vector` fails the test.
*/
*/
#define NLOHMANN_JSON_HAS_HELPER(type) \
#define NLOHMANN_JSON_HAS_HELPER(type) \
template<typename T> struct has_##type { \
template<typename T> struct has_##type { \
private: \
template<typename U, typename = typename U::type> \
template<typename U, typename = typename U::type> \
static int detect(U &&); \
static int detect(U &&); \
static void detect(...); \
static void detect(...); \
public: \
static constexpr bool value = \
static constexpr bool value = \
std::is_integral<decltype(detect(std::declval<T>()))>::value; \
std::is_integral<decltype(detect(std::declval<T>()))>::value; \
}
}
include/nlohmann/detail/meta/type_traits.hpp
View file @
eb30ff06
...
@@ -141,14 +141,12 @@ struct is_compatible_integer_type
...
@@ -141,14 +141,12 @@ struct is_compatible_integer_type
template
<
typename
BasicJsonType
,
typename
T
>
template
<
typename
BasicJsonType
,
typename
T
>
struct
has_from_json
struct
has_from_json
{
{
private:
// also check the return type of from_json
// also check the return type of from_json
template
<
typename
U
,
typename
=
enable_if_t
<
std
::
is_same
<
void
,
decltype
(
uncvref_t
<
U
>
::
from_json
(
template
<
typename
U
,
typename
=
enable_if_t
<
std
::
is_same
<
void
,
decltype
(
uncvref_t
<
U
>
::
from_json
(
std
::
declval
<
BasicJsonType
>
(),
std
::
declval
<
T
&>
()))
>::
value
>>
std
::
declval
<
BasicJsonType
>
(),
std
::
declval
<
T
&>
()))
>::
value
>>
static
int
detect
(
U
&&
);
static
int
detect
(
U
&&
);
static
void
detect
(...);
static
void
detect
(...);
public:
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
detect
(
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
detect
(
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
};
};
...
@@ -158,7 +156,6 @@ struct has_from_json
...
@@ -158,7 +156,6 @@ struct has_from_json
template
<
typename
BasicJsonType
,
typename
T
>
template
<
typename
BasicJsonType
,
typename
T
>
struct
has_non_default_from_json
struct
has_non_default_from_json
{
{
private:
template
<
template
<
typename
U
,
typename
U
,
typename
=
enable_if_t
<
std
::
is_same
<
typename
=
enable_if_t
<
std
::
is_same
<
...
@@ -166,7 +163,6 @@ struct has_non_default_from_json
...
@@ -166,7 +163,6 @@ struct has_non_default_from_json
static
int
detect
(
U
&&
);
static
int
detect
(
U
&&
);
static
void
detect
(...);
static
void
detect
(...);
public:
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
detect
(
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
detect
(
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
};
};
...
@@ -175,13 +171,11 @@ struct has_non_default_from_json
...
@@ -175,13 +171,11 @@ struct has_non_default_from_json
template
<
typename
BasicJsonType
,
typename
T
>
template
<
typename
BasicJsonType
,
typename
T
>
struct
has_to_json
struct
has_to_json
{
{
private:
template
<
typename
U
,
typename
=
decltype
(
uncvref_t
<
U
>
::
to_json
(
template
<
typename
U
,
typename
=
decltype
(
uncvref_t
<
U
>
::
to_json
(
std
::
declval
<
BasicJsonType
&>
(),
std
::
declval
<
T
>
()))
>
std
::
declval
<
BasicJsonType
&>
(),
std
::
declval
<
T
>
()))
>
static
int
detect
(
U
&&
);
static
int
detect
(
U
&&
);
static
void
detect
(...);
static
void
detect
(...);
public:
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
detect
(
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
detect
(
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
};
};
...
...
single_include/nlohmann/json.hpp
View file @
eb30ff06
...
@@ -230,11 +230,9 @@ contains a `mapped_type`, whereas `std::vector` fails the test.
...
@@ -230,11 +230,9 @@ contains a `mapped_type`, whereas `std::vector` fails the test.
*/
*/
#define NLOHMANN_JSON_HAS_HELPER(type) \
#define NLOHMANN_JSON_HAS_HELPER(type) \
template<typename T> struct has_##type { \
template<typename T> struct has_##type { \
private: \
template<typename U, typename = typename U::type> \
template<typename U, typename = typename U::type> \
static int detect(U &&); \
static int detect(U &&); \
static void detect(...); \
static void detect(...); \
public: \
static constexpr bool value = \
static constexpr bool value = \
std::is_integral<decltype(detect(std::declval<T>()))>::value; \
std::is_integral<decltype(detect(std::declval<T>()))>::value; \
}
}
...
@@ -471,14 +469,12 @@ struct is_compatible_integer_type
...
@@ -471,14 +469,12 @@ struct is_compatible_integer_type
template
<
typename
BasicJsonType
,
typename
T
>
template
<
typename
BasicJsonType
,
typename
T
>
struct
has_from_json
struct
has_from_json
{
{
private:
// also check the return type of from_json
// also check the return type of from_json
template
<
typename
U
,
typename
=
enable_if_t
<
std
::
is_same
<
void
,
decltype
(
uncvref_t
<
U
>
::
from_json
(
template
<
typename
U
,
typename
=
enable_if_t
<
std
::
is_same
<
void
,
decltype
(
uncvref_t
<
U
>
::
from_json
(
std
::
declval
<
BasicJsonType
>
(),
std
::
declval
<
T
&>
()))
>::
value
>>
std
::
declval
<
BasicJsonType
>
(),
std
::
declval
<
T
&>
()))
>::
value
>>
static
int
detect
(
U
&&
);
static
int
detect
(
U
&&
);
static
void
detect
(...);
static
void
detect
(...);
public:
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
detect
(
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
detect
(
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
};
};
...
@@ -488,7 +484,6 @@ struct has_from_json
...
@@ -488,7 +484,6 @@ struct has_from_json
template
<
typename
BasicJsonType
,
typename
T
>
template
<
typename
BasicJsonType
,
typename
T
>
struct
has_non_default_from_json
struct
has_non_default_from_json
{
{
private:
template
<
template
<
typename
U
,
typename
U
,
typename
=
enable_if_t
<
std
::
is_same
<
typename
=
enable_if_t
<
std
::
is_same
<
...
@@ -496,7 +491,6 @@ struct has_non_default_from_json
...
@@ -496,7 +491,6 @@ struct has_non_default_from_json
static
int
detect
(
U
&&
);
static
int
detect
(
U
&&
);
static
void
detect
(...);
static
void
detect
(...);
public:
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
detect
(
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
detect
(
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
};
};
...
@@ -505,13 +499,11 @@ struct has_non_default_from_json
...
@@ -505,13 +499,11 @@ struct has_non_default_from_json
template
<
typename
BasicJsonType
,
typename
T
>
template
<
typename
BasicJsonType
,
typename
T
>
struct
has_to_json
struct
has_to_json
{
{
private:
template
<
typename
U
,
typename
=
decltype
(
uncvref_t
<
U
>
::
to_json
(
template
<
typename
U
,
typename
=
decltype
(
uncvref_t
<
U
>
::
to_json
(
std
::
declval
<
BasicJsonType
&>
(),
std
::
declval
<
T
>
()))
>
std
::
declval
<
BasicJsonType
&>
(),
std
::
declval
<
T
>
()))
>
static
int
detect
(
U
&&
);
static
int
detect
(
U
&&
);
static
void
detect
(...);
static
void
detect
(...);
public:
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
detect
(
static
constexpr
bool
value
=
std
::
is_integral
<
decltype
(
detect
(
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
value
;
std
::
declval
<
typename
BasicJsonType
::
template
json_serializer
<
T
,
void
>
>
()))
>::
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