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
e2dbe7a6
Commit
e2dbe7a6
authored
Nov 21, 2016
by
Théo DELRIEU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly constrain basic_json udt constructor
parent
0d91113c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
json.hpp
src/json.hpp
+14
-10
No files found.
src/json.hpp
View file @
e2dbe7a6
...
@@ -512,7 +512,7 @@ class basic_json
...
@@ -512,7 +512,7 @@ class basic_json
/// workaround type for MSVC
/// workaround type for MSVC
using
basic_json_t
=
basic_json
<
ObjectType
,
ArrayType
,
StringType
,
using
basic_json_t
=
basic_json
<
ObjectType
,
ArrayType
,
StringType
,
BooleanType
,
NumberIntegerType
,
NumberUnsignedType
,
NumberFloatType
,
BooleanType
,
NumberIntegerType
,
NumberUnsignedType
,
NumberFloatType
,
AllocatorType
>
;
AllocatorType
,
JSONSerializer
>
;
public
:
public
:
// forward declarations
// forward declarations
...
@@ -1565,15 +1565,19 @@ class basic_json
...
@@ -1565,15 +1565,19 @@ class basic_json
}
}
// constructor chosen when JSONSerializer::to_json exists for type T
// constructor chosen when JSONSerializer::to_json exists for type T
template
<
typename
T
,
enable_if_t
<
detail
::
has_to_json
<
template
<
typename
T
,
enable_if_t
<
detail
::
conjunction
<
detail
::
negation
<
std
::
is_same
<
uncvref_t
<
T
>
,
basic_json_t
>>
,
JSONSerializer
,
basic_json
,
uncvref_t
<
T
>>::
value
and
not
(
detail
::
is_compatible_object_type
<
object_t
,
uncvref_t
<
T
>>::
value
or
detail
::
negation
<
detail
::
disjunction
<
detail
::
is_compatible_array_type
<
basic_json_t
,
uncvref_t
<
T
>>::
value
or
detail
::
is_compatible_array_type
<
basic_json_t
,
uncvref_t
<
T
>>
,
detail
::
is_compatible_float_type
<
number_float_t
,
uncvref_t
<
T
>>::
value
or
detail
::
is_compatible_object_type
<
object_t
,
uncvref_t
<
T
>>
,
detail
::
is_compatible_integer_type
<
number_integer_t
,
uncvref_t
<
T
>>::
value
or
detail
::
is_compatible_float_type
<
number_float_t
,
uncvref_t
<
T
>>
,
detail
::
is_compatible_unsigned_integer_type
<
number_unsigned_t
,
uncvref_t
<
T
>>::
value
or
detail
::
is_compatible_integer_type
<
number_integer_t
,
uncvref_t
<
T
>>
,
std
::
is_constructible
<
string_t
,
uncvref_t
<
T
>>::
value
or
detail
::
is_compatible_unsigned_integer_type
<
number_unsigned_t
,
uncvref_t
<
T
>>
,
std
::
is_base_of
<
std
::
istream
,
uncvref_t
<
T
>>::
value
or
std
::
is_constructible
<
string_t
,
uncvref_t
<
T
>>
,
std
::
is_same
<
boolean_t
,
uncvref_t
<
T
>>::
value
),
int
>
=
0
>
std
::
is_base_of
<
std
::
istream
,
uncvref_t
<
T
>>
,
std
::
is_same
<
boolean_t
,
uncvref_t
<
T
>>>>
,
detail
::
has_to_json
<
JSONSerializer
,
basic_json
,
uncvref_t
<
T
>>
>::
value
,
int
>
=
0
>
explicit
basic_json
(
T
&&
val
)
explicit
basic_json
(
T
&&
val
)
{
{
JSONSerializer
<
uncvref_t
<
T
>>::
to_json
(
*
this
,
std
::
forward
<
T
>
(
val
));
JSONSerializer
<
uncvref_t
<
T
>>::
to_json
(
*
this
,
std
::
forward
<
T
>
(
val
));
...
...
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