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
b2543e06
Commit
b2543e06
authored
Jan 08, 2017
by
Théo DELRIEU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed is_compatible_float_type trait
parent
be6b417c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
28 deletions
+6
-28
src/json.hpp
src/json.hpp
+3
-14
src/json.hpp.re2c
src/json.hpp.re2c
+3
-14
No files found.
src/json.hpp
View file @
b2543e06
...
@@ -461,14 +461,6 @@ struct is_compatible_integer_type
...
@@ -461,14 +461,6 @@ struct is_compatible_integer_type
RealIntegerType
,
CompatibleNumberIntegerType
>
::
value
;
RealIntegerType
,
CompatibleNumberIntegerType
>
::
value
;
};
};
template
<
typename
RealFloat
,
typename
CompatibleFloat
>
struct
is_compatible_float_type
{
static
constexpr
auto
value
=
std
::
is_constructible
<
RealFloat
,
CompatibleFloat
>::
value
and
std
::
is_floating_point
<
CompatibleFloat
>::
value
;
};
template
<
typename
BasicJson
,
typename
T
>
template
<
typename
BasicJson
,
typename
T
>
struct
is_basic_json_nested_type
struct
is_basic_json_nested_type
{
{
...
@@ -568,12 +560,9 @@ void to_json(Json &j, const CompatibleString &s)
...
@@ -568,12 +560,9 @@ void to_json(Json &j, const CompatibleString &s)
external_constructor
<
value_t
::
string
>::
construct
(
j
,
s
);
external_constructor
<
value_t
::
string
>::
construct
(
j
,
s
);
}
}
template
<
template
<
typename
Json
,
typename
FloatType
,
typename
Json
,
typename
CompatibleNumberFloatType
,
enable_if_t
<
std
::
is_floating_point
<
FloatType
>
::
value
,
int
>
=
0
>
enable_if_t
<
is_compatible_float_type
<
typename
Json
::
number_float_t
,
void
to_json
(
Json
&
j
,
FloatType
val
)
noexcept
CompatibleNumberFloatType
>
::
value
,
int
>
=
0
>
void
to_json
(
Json
&
j
,
CompatibleNumberFloatType
val
)
noexcept
{
{
external_constructor
<
value_t
::
number_float
>::
construct
(
j
,
val
);
external_constructor
<
value_t
::
number_float
>::
construct
(
j
,
val
);
}
}
...
...
src/json.hpp.re2c
View file @
b2543e06
...
@@ -461,14 +461,6 @@ struct is_compatible_integer_type
...
@@ -461,14 +461,6 @@ struct is_compatible_integer_type
RealIntegerType, CompatibleNumberIntegerType > ::value;
RealIntegerType, CompatibleNumberIntegerType > ::value;
};
};
template <typename RealFloat, typename CompatibleFloat>
struct is_compatible_float_type
{
static constexpr auto value =
std::is_constructible<RealFloat, CompatibleFloat>::value and
std::is_floating_point<CompatibleFloat>::value;
};
template <typename BasicJson, typename T>
template <typename BasicJson, typename T>
struct is_basic_json_nested_type
struct is_basic_json_nested_type
{
{
...
@@ -568,12 +560,9 @@ void to_json(Json &j, const CompatibleString &s)
...
@@ -568,12 +560,9 @@ void to_json(Json &j, const CompatibleString &s)
external_constructor<value_t::string>::construct(j, s);
external_constructor<value_t::string>::construct(j, s);
}
}
template <
template <typename Json, typename FloatType,
typename Json, typename CompatibleNumberFloatType,
enable_if_t<std::is_floating_point<FloatType>::value, int> = 0>
enable_if_t<is_compatible_float_type<typename Json::number_float_t,
void to_json(Json &j, FloatType val) noexcept
CompatibleNumberFloatType>::value,
int> = 0>
void to_json(Json &j, CompatibleNumberFloatType val) noexcept
{
{
external_constructor<value_t::number_float>::construct(j, val);
external_constructor<value_t::number_float>::construct(j, 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