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
13760857
Unverified
Commit
13760857
authored
Sep 05, 2018
by
Théo DELRIEU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor is_compatible_array_type
parent
924e95c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
22 deletions
+34
-22
include/nlohmann/detail/meta/type_traits.hpp
include/nlohmann/detail/meta/type_traits.hpp
+17
-11
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+17
-11
No files found.
include/nlohmann/detail/meta/type_traits.hpp
View file @
13760857
...
...
@@ -117,20 +117,26 @@ struct is_basic_json_nested_type
std
::
is_same
<
T
,
typename
BasicJsonType
::
const_reverse_iterator
>::
value
;
};
template
<
class
BasicJsonType
,
class
CompatibleArrayType
>
struct
is_compatible_array_type
template
<
typename
BasicJsonType
,
typename
CompatibleArrayType
,
typename
=
void
>
struct
is_compatible_array_type_impl
:
std
::
false_type
{};
template
<
typename
BasicJsonType
,
typename
CompatibleArrayType
>
struct
is_compatible_array_type_impl
<
BasicJsonType
,
CompatibleArrayType
,
enable_if_t
<
is_detected
<
value_type_t
,
CompatibleArrayType
>::
value
and
is_detected
<
iterator_t
,
CompatibleArrayType
>::
value
>>
{
static
auto
constexpr
value
=
conjunction
<
negation
<
std
::
is_same
<
void
,
CompatibleArrayType
>>
,
negation
<
is_compatible_object_type
<
BasicJsonType
,
CompatibleArrayType
>>
,
negation
<
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleArrayType
>>
,
negation
<
is_basic_json_nested_type
<
BasicJsonType
,
CompatibleArrayType
>>
,
is_detected
<
value_type_t
,
CompatibleArrayType
>
,
is_detected
<
iterator_t
,
CompatibleArrayType
>>::
value
;
static
constexpr
auto
value
=
not
(
is_compatible_object_type
<
BasicJsonType
,
CompatibleArrayType
>::
value
or
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleArrayType
>::
value
or
is_basic_json_nested_type
<
BasicJsonType
,
CompatibleArrayType
>::
value
);
};
template
<
typename
BasicJsonType
,
typename
CompatibleArrayType
>
struct
is_compatible_array_type
:
is_compatible_array_type_impl
<
BasicJsonType
,
CompatibleArrayType
>
{};
template
<
bool
,
typename
,
typename
>
struct
is_compatible_integer_type_impl
:
std
::
false_type
{};
...
...
single_include/nlohmann/json.hpp
View file @
13760857
...
...
@@ -497,20 +497,26 @@ struct is_basic_json_nested_type
std
::
is_same
<
T
,
typename
BasicJsonType
::
const_reverse_iterator
>::
value
;
};
template
<
class
BasicJsonType
,
class
CompatibleArrayType
>
struct
is_compatible_array_type
template
<
typename
BasicJsonType
,
typename
CompatibleArrayType
,
typename
=
void
>
struct
is_compatible_array_type_impl
:
std
::
false_type
{};
template
<
typename
BasicJsonType
,
typename
CompatibleArrayType
>
struct
is_compatible_array_type_impl
<
BasicJsonType
,
CompatibleArrayType
,
enable_if_t
<
is_detected
<
value_type_t
,
CompatibleArrayType
>::
value
and
is_detected
<
iterator_t
,
CompatibleArrayType
>::
value
>>
{
static
auto
constexpr
value
=
conjunction
<
negation
<
std
::
is_same
<
void
,
CompatibleArrayType
>>
,
negation
<
is_compatible_object_type
<
BasicJsonType
,
CompatibleArrayType
>>
,
negation
<
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleArrayType
>>
,
negation
<
is_basic_json_nested_type
<
BasicJsonType
,
CompatibleArrayType
>>
,
is_detected
<
value_type_t
,
CompatibleArrayType
>
,
is_detected
<
iterator_t
,
CompatibleArrayType
>>::
value
;
static
constexpr
auto
value
=
not
(
is_compatible_object_type
<
BasicJsonType
,
CompatibleArrayType
>::
value
or
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleArrayType
>::
value
or
is_basic_json_nested_type
<
BasicJsonType
,
CompatibleArrayType
>::
value
);
};
template
<
typename
BasicJsonType
,
typename
CompatibleArrayType
>
struct
is_compatible_array_type
:
is_compatible_array_type_impl
<
BasicJsonType
,
CompatibleArrayType
>
{};
template
<
bool
,
typename
,
typename
>
struct
is_compatible_integer_type_impl
:
std
::
false_type
{};
...
...
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