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
47bc4021
Commit
47bc4021
authored
Nov 22, 2016
by
Théo Delrieu
Committed by
Théo DELRIEU
Jan 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only use conjunction & co when needed to avoid MSVC crashing
parent
ee19acaf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
24 deletions
+35
-24
json.hpp
src/json.hpp
+35
-24
No files found.
src/json.hpp
View file @
47bc4021
...
@@ -205,25 +205,28 @@ template <class BasicJson, class CompatibleArrayType>
...
@@ -205,25 +205,28 @@ template <class BasicJson, class CompatibleArrayType>
struct
is_compatible_array_type_impl
<
true
,
BasicJson
,
CompatibleArrayType
>
struct
is_compatible_array_type_impl
<
true
,
BasicJson
,
CompatibleArrayType
>
{
{
static
constexpr
auto
value
=
static
constexpr
auto
value
=
conjunction
<
not
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
iterator
>::
value
and
negation
<
disjunction
<
not
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
const_iterator
>::
value
and
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
iterator
>
,
not
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
reverse_iterator
>::
value
and
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
const_iterator
>
,
not
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
const_reverse_iterator
>::
value
and
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
reverse_iterator
>
,
not
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
array_t
::
iterator
>::
value
and
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
const_reverse_iterator
>
,
not
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
array_t
::
const_iterator
>::
value
;
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
array_t
::
iterator
>
,
std
::
is_same
<
CompatibleArrayType
,
typename
BasicJson
::
array_t
::
const_iterator
>>>
,
std
::
is_constructible
<
BasicJson
,
typename
CompatibleArrayType
::
value_type
>>::
value
;
};
};
template
<
class
BasicJson
,
class
CompatibleArrayType
>
template
<
class
BasicJson
,
class
CompatibleArrayType
>
struct
is_compatible_array_type
struct
is_compatible_array_type
{
{
static
auto
constexpr
value
=
is_compatible_array_type_impl
<
static
auto
constexpr
value
=
disjunction
<
std
::
is_same
<
BasicJson
,
CompatibleArrayType
>
,
conjunction
<
negation
<
is_compatible_object_type
<
typename
BasicJson
::
object_t
,
CompatibleArrayType
>>
,
is_compatible_array_type_impl
<
conjunction
<
negation
<
// MSVC has troubles on that one
std
::
is_same
<
void
,
CompatibleArrayType
>>
,
negation
<
is_compatible_object_type
<
typename
BasicJson
::
object_t
,
CompatibleArrayType
>>
,
has_value_type
<
CompatibleArrayType
>
,
has_value_type
<
CompatibleArrayType
>
,
has_iterator
<
CompatibleArrayType
>>::
value
,
BasicJson
,
CompatibleArrayType
>::
value
;
has_iterator
<
CompatibleArrayType
>>::
value
,
BasicJson
,
CompatibleArrayType
>>::
value
;
};
};
template
<
bool
,
typename
,
typename
>
template
<
bool
,
typename
,
typename
>
...
@@ -270,14 +273,16 @@ struct is_compatible_float_type
...
@@ -270,14 +273,16 @@ struct is_compatible_float_type
template
<
typename
T
,
typename
BasicJson
>
template
<
typename
T
,
typename
BasicJson
>
struct
is_compatible_basic_json_type
struct
is_compatible_basic_json_type
{
{
static
auto
constexpr
value
=
disjunction
<
static
auto
constexpr
value
=
is_compatible_array_type
<
BasicJson
,
T
>
,
is_compatible_object_type
<
typename
BasicJson
::
object_t
,
T
>
,
std
::
is_same
<
T
,
BasicJson
>::
value
or
is_compatible_float_type
<
typename
BasicJson
::
number_float_t
,
T
>
,
std
::
is_constructible
<
typename
BasicJson
::
string_t
,
T
>::
value
or
is_compatible_integer_type
<
typename
BasicJson
::
number_integer_t
,
T
>
,
std
::
is_same
<
typename
BasicJson
::
boolean_t
,
T
>::
value
or
is_compatible_unsigned_integer_type
<
typename
BasicJson
::
number_unsigned_t
,
T
>
,
is_compatible_array_type
<
BasicJson
,
T
>::
value
or
std
::
is_constructible
<
typename
BasicJson
::
string_t
,
T
>
,
is_compatible_object_type
<
typename
BasicJson
::
object_t
,
T
>::
value
or
std
::
is_same
<
typename
BasicJson
::
boolean_t
,
T
>>::
value
;
is_compatible_float_type
<
typename
BasicJson
::
number_float_t
,
T
>::
value
or
is_compatible_integer_type
<
typename
BasicJson
::
number_integer_t
,
T
>::
value
or
is_compatible_unsigned_integer_type
<
typename
BasicJson
::
number_unsigned_t
,
T
>::
value
;
};
};
template
<
template
<
typename
,
typename
>
class
JSONSerializer
,
typename
Json
,
template
<
template
<
typename
,
typename
>
class
JSONSerializer
,
typename
Json
,
...
@@ -1531,10 +1536,16 @@ class basic_json
...
@@ -1531,10 +1536,16 @@ class basic_json
@since version 1.0.0
@since version 1.0.0
*/
*/
template
<
class
CompatibleArrayType
,
enable_if_t
<
detail
::
is_compatible_array_type
<
basic_json_t
,
CompatibleArrayType
>::
value
,
int
>
=
0
>
template
<
basic_json
(
const
CompatibleArrayType
&
val
)
class
CompatibleArrayType
,
:
m_type
(
value_t
::
array
)
enable_if_t
<
{
detail
::
disjunction
<
// MSVC..
std
::
is_same
<
uncvref_t
<
CompatibleArrayType
>
,
basic_json_t
>
,
detail
::
is_compatible_array_type
<
basic_json_t
,
CompatibleArrayType
>>::
value
,
int
>
=
0
>
basic_json
(
const
CompatibleArrayType
&
val
)
:
m_type
(
value_t
::
array
)
{
using
std
::
begin
;
using
std
::
begin
;
using
std
::
end
;
using
std
::
end
;
m_value
.
array
=
create
<
array_t
>
(
begin
(
val
),
end
(
val
));
m_value
.
array
=
create
<
array_t
>
(
begin
(
val
),
end
(
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