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
924e95c6
Unverified
Commit
924e95c6
authored
Sep 05, 2018
by
Théo DELRIEU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor is_compatible_string_type
parent
e84195ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
24 deletions
+20
-24
include/nlohmann/detail/meta/type_traits.hpp
include/nlohmann/detail/meta/type_traits.hpp
+10
-12
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+10
-12
No files found.
include/nlohmann/detail/meta/type_traits.hpp
View file @
924e95c6
...
...
@@ -90,25 +90,23 @@ template <typename BasicJsonType, typename CompatibleObjectType>
struct
is_compatible_object_type
:
is_compatible_object_type_impl
<
BasicJsonType
,
CompatibleObjectType
>
{};
template
<
bool
B
,
class
RealType
,
class
CompatibleStringType
>
template
<
typename
BasicJsonType
,
typename
CompatibleStringType
,
typename
=
void
>
struct
is_compatible_string_type_impl
:
std
::
false_type
{};
template
<
class
RealType
,
class
CompatibleStringType
>
struct
is_compatible_string_type_impl
<
true
,
RealType
,
CompatibleStringType
>
template
<
typename
BasicJsonType
,
typename
CompatibleStringType
>
struct
is_compatible_string_type_impl
<
BasicJsonType
,
CompatibleStringType
,
enable_if_t
<
is_detected_exact
<
typename
BasicJsonType
::
string_t
::
value_type
,
value_type_t
,
CompatibleStringType
>::
value
>>
{
static
constexpr
auto
value
=
std
::
is_same
<
typename
RealType
::
value_type
,
typename
CompatibleStringType
::
value_type
>::
value
and
std
::
is_constructible
<
RealType
,
CompatibleStringType
>::
value
;
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleStringType
>::
value
;
};
template
<
class
BasicJsonType
,
class
CompatibleStringType
>
template
<
typename
BasicJsonType
,
typename
CompatibleStringType
>
struct
is_compatible_string_type
{
static
auto
constexpr
value
=
is_compatible_string_type_impl
<
conjunction
<
negation
<
std
::
is_same
<
void
,
CompatibleStringType
>>
,
is_detected
<
value_type_t
,
CompatibleStringType
>>::
value
,
typename
BasicJsonType
::
string_t
,
CompatibleStringType
>::
value
;
};
:
is_compatible_string_type_impl
<
BasicJsonType
,
CompatibleStringType
>
{};
template
<
typename
BasicJsonType
,
typename
T
>
struct
is_basic_json_nested_type
...
...
single_include/nlohmann/json.hpp
View file @
924e95c6
...
...
@@ -470,25 +470,23 @@ template <typename BasicJsonType, typename CompatibleObjectType>
struct
is_compatible_object_type
:
is_compatible_object_type_impl
<
BasicJsonType
,
CompatibleObjectType
>
{};
template
<
bool
B
,
class
RealType
,
class
CompatibleStringType
>
template
<
typename
BasicJsonType
,
typename
CompatibleStringType
,
typename
=
void
>
struct
is_compatible_string_type_impl
:
std
::
false_type
{};
template
<
class
RealType
,
class
CompatibleStringType
>
struct
is_compatible_string_type_impl
<
true
,
RealType
,
CompatibleStringType
>
template
<
typename
BasicJsonType
,
typename
CompatibleStringType
>
struct
is_compatible_string_type_impl
<
BasicJsonType
,
CompatibleStringType
,
enable_if_t
<
is_detected_exact
<
typename
BasicJsonType
::
string_t
::
value_type
,
value_type_t
,
CompatibleStringType
>::
value
>>
{
static
constexpr
auto
value
=
std
::
is_same
<
typename
RealType
::
value_type
,
typename
CompatibleStringType
::
value_type
>::
value
and
std
::
is_constructible
<
RealType
,
CompatibleStringType
>::
value
;
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleStringType
>::
value
;
};
template
<
class
BasicJsonType
,
class
CompatibleStringType
>
template
<
typename
BasicJsonType
,
typename
CompatibleStringType
>
struct
is_compatible_string_type
{
static
auto
constexpr
value
=
is_compatible_string_type_impl
<
conjunction
<
negation
<
std
::
is_same
<
void
,
CompatibleStringType
>>
,
is_detected
<
value_type_t
,
CompatibleStringType
>>::
value
,
typename
BasicJsonType
::
string_t
,
CompatibleStringType
>::
value
;
};
:
is_compatible_string_type_impl
<
BasicJsonType
,
CompatibleStringType
>
{};
template
<
typename
BasicJsonType
,
typename
T
>
struct
is_basic_json_nested_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