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
ec955f08
Commit
ec955f08
authored
Apr 12, 2020
by
Artöm Bakri Al-Sarmini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Templatize basic_json ctor from json_ref
parent
4396a68d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
8 deletions
+34
-8
type_traits.hpp
include/nlohmann/detail/meta/type_traits.hpp
+13
-0
json.hpp
include/nlohmann/json.hpp
+4
-4
json.hpp
single_include/nlohmann/json.hpp
+17
-4
No files found.
include/nlohmann/detail/meta/type_traits.hpp
View file @
ec955f08
...
@@ -41,6 +41,19 @@ template<typename> struct is_basic_json : std::false_type {};
...
@@ -41,6 +41,19 @@ template<typename> struct is_basic_json : std::false_type {};
NLOHMANN_BASIC_JSON_TPL_DECLARATION
NLOHMANN_BASIC_JSON_TPL_DECLARATION
struct
is_basic_json
<
NLOHMANN_BASIC_JSON_TPL
>
:
std
::
true_type
{};
struct
is_basic_json
<
NLOHMANN_BASIC_JSON_TPL
>
:
std
::
true_type
{};
//////////////////////
// jspn_ref helpers //
//////////////////////
template
<
typename
>
class
json_ref
;
template
<
typename
>
struct
is_json_ref
:
std
::
false_type
{};
template
<
typename
T
>
struct
is_json_ref
<
json_ref
<
T
>>
:
std
::
true_type
{};
//////////////////////////
//////////////////////////
// aliases for detected //
// aliases for detected //
//////////////////////////
//////////////////////////
...
...
include/nlohmann/json.hpp
View file @
ec955f08
...
@@ -1773,10 +1773,10 @@ class basic_json
...
@@ -1773,10 +1773,10 @@ class basic_json
// other constructors and destructor //
// other constructors and destructor //
///////////////////////////////////////
///////////////////////////////////////
/// @private
template
<
typename
JsonRef
,
basic_json
(
const
detail
::
json_ref
<
basic_json
>&
ref
)
detail
::
enable_if_t
<
detail
::
conjunction
<
detail
::
is_json_ref
<
JsonRef
>
,
:
basic_json
(
ref
.
moved_or_copied
())
std
::
is_same
<
typename
JsonRef
::
value_type
,
basic_json
>>::
value
,
int
>
=
0
>
{}
basic_json
(
const
JsonRef
&
ref
)
:
basic_json
(
ref
.
moved_or_copied
())
{}
/*!
/*!
@brief copy constructor
@brief copy constructor
...
...
single_include/nlohmann/json.hpp
View file @
ec955f08
...
@@ -2794,6 +2794,19 @@ template<typename> struct is_basic_json : std::false_type {};
...
@@ -2794,6 +2794,19 @@ template<typename> struct is_basic_json : std::false_type {};
NLOHMANN_BASIC_JSON_TPL_DECLARATION
NLOHMANN_BASIC_JSON_TPL_DECLARATION
struct
is_basic_json
<
NLOHMANN_BASIC_JSON_TPL
>
:
std
::
true_type
{};
struct
is_basic_json
<
NLOHMANN_BASIC_JSON_TPL
>
:
std
::
true_type
{};
//////////////////////
// jspn_ref helpers //
//////////////////////
template
<
typename
>
class
json_ref
;
template
<
typename
>
struct
is_json_ref
:
std
::
false_type
{};
template
<
typename
T
>
struct
is_json_ref
<
json_ref
<
T
>>
:
std
::
true_type
{};
//////////////////////////
//////////////////////////
// aliases for detected //
// aliases for detected //
//////////////////////////
//////////////////////////
...
@@ -16632,10 +16645,10 @@ class basic_json
...
@@ -16632,10 +16645,10 @@ class basic_json
// other constructors and destructor //
// other constructors and destructor //
///////////////////////////////////////
///////////////////////////////////////
/// @private
template
<
typename
JsonRef
,
basic_json
(
const
detail
::
json_ref
<
basic_json
>&
ref
)
detail
::
enable_if_t
<
detail
::
conjunction
<
detail
::
is_json_ref
<
JsonRef
>
,
:
basic_json
(
ref
.
moved_or_copied
())
std
::
is_same
<
typename
JsonRef
::
value_type
,
basic_json
>>::
value
,
int
>
=
0
>
{}
basic_json
(
const
JsonRef
&
ref
)
:
basic_json
(
ref
.
moved_or_copied
())
{}
/*!
/*!
@brief copy constructor
@brief copy constructor
...
...
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