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
714c5926
Commit
714c5926
authored
Jun 01, 2018
by
Guillaume Racicot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disabled implicit conversion to string_view on MSVC 15.13 and older
parent
aaee18ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
include/nlohmann/json.hpp
include/nlohmann/json.hpp
+2
-2
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+3
-10
test/src/unit-conversions.cpp
test/src/unit-conversions.cpp
+7
-0
No files found.
include/nlohmann/json.hpp
View file @
714c5926
...
@@ -2821,9 +2821,9 @@ class basic_json
...
@@ -2821,9 +2821,9 @@ class basic_json
not
detail
::
is_basic_json
<
ValueType
>::
value
not
detail
::
is_basic_json
<
ValueType
>::
value
#ifndef _MSC_VER // fix for issue #167 operator<< ambiguity under VS2015
#ifndef _MSC_VER // fix for issue #167 operator<< ambiguity under VS2015
and
not
std
::
is_same
<
ValueType
,
std
::
initializer_list
<
typename
string_t
::
value_type
>>::
value
and
not
std
::
is_same
<
ValueType
,
std
::
initializer_list
<
typename
string_t
::
value_type
>>::
value
#endif
#if defined(JSON_HAS_CPP_17) && _MSC_VER <= 1913
#if defined(JSON_HAS_CPP_17)
and
not
std
::
is_same
<
ValueType
,
typename
std
::
string_view
>::
value
and
not
std
::
is_same
<
ValueType
,
typename
std
::
string_view
>::
value
#endif
#endif
#endif
,
int
>::
type
=
0
>
,
int
>::
type
=
0
>
operator
ValueType
()
const
operator
ValueType
()
const
...
...
single_include/nlohmann/json.hpp
View file @
714c5926
...
@@ -1321,16 +1321,6 @@ struct external_constructor<value_t::string>
...
@@ -1321,16 +1321,6 @@ struct external_constructor<value_t::string>
j
.
m_value
=
std
::
move
(
s
);
j
.
m_value
=
std
::
move
(
s
);
j
.
assert_invariant
();
j
.
assert_invariant
();
}
}
template
<
typename
BasicJsonType
,
typename
CompatibleStringType
,
enable_if_t
<
not
std
::
is_same
<
CompatibleStringType
,
typename
BasicJsonType
::
string_t
>
::
value
,
int
>
=
0
>
static
void
construct
(
BasicJsonType
&
j
,
const
CompatibleStringType
&
str
)
{
j
.
m_type
=
value_t
::
string
;
j
.
m_value
.
string
=
j
.
template
create
<
typename
BasicJsonType
::
string_t
>(
str
);
j
.
assert_invariant
();
}
};
};
template
<
>
template
<
>
...
@@ -12480,6 +12470,9 @@ class basic_json
...
@@ -12480,6 +12470,9 @@ class basic_json
not
detail
::
is_basic_json
<
ValueType
>::
value
not
detail
::
is_basic_json
<
ValueType
>::
value
#ifndef _MSC_VER // fix for issue #167 operator<< ambiguity under VS2015
#ifndef _MSC_VER // fix for issue #167 operator<< ambiguity under VS2015
and
not
std
::
is_same
<
ValueType
,
std
::
initializer_list
<
typename
string_t
::
value_type
>>::
value
and
not
std
::
is_same
<
ValueType
,
std
::
initializer_list
<
typename
string_t
::
value_type
>>::
value
#if defined(JSON_HAS_CPP_17) && _MSC_VER <= 1913
and
not
std
::
is_same
<
ValueType
,
typename
std
::
string_view
>::
value
#endif
#endif
#endif
,
int
>::
type
=
0
>
,
int
>::
type
=
0
>
operator
ValueType
()
const
operator
ValueType
()
const
...
...
test/src/unit-conversions.cpp
View file @
714c5926
...
@@ -39,6 +39,13 @@ using nlohmann::json;
...
@@ -39,6 +39,13 @@ using nlohmann::json;
#include <unordered_set>
#include <unordered_set>
#include <valarray>
#include <valarray>
#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
#define JSON_HAS_CPP_17
#define JSON_HAS_CPP_14
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1)
#define JSON_HAS_CPP_14
#endif
#if defined(JSON_HAS_CPP_17)
#if defined(JSON_HAS_CPP_17)
#include <string_view>
#include <string_view>
#endif
#endif
...
...
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