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
600ad330
Commit
600ad330
authored
Jan 24, 2016
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup after PR #189
parent
21a44da8
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
756 additions
and
352 deletions
+756
-352
README.md
README.md
+2
-1
src/json.hpp
src/json.hpp
+742
-339
src/json.hpp.re2c
src/json.hpp.re2c
+8
-8
test/unit.cpp
test/unit.cpp
+4
-4
No files found.
README.md
View file @
600ad330
...
...
@@ -388,6 +388,7 @@ I deeply appreciate the help of the following people.
-
[
406345
](
https://github.com/406345
)
fixed two small warnings.
-
[
Glen Fernandes
](
https://github.com/glenfe
)
noted a potential portability problem in the
`has_mapped_type`
function.
-
[
Corbin Hughes
](
https://github.com/nibroc
)
fixed some typos in the contribution guidelines.
-
[
twelsby
](
https://github.com/twelsby
)
fixed the array subscript operator.
Thanks a lot for helping out!
...
...
@@ -404,7 +405,7 @@ $ make
$
./json_unit
"*"
===============================================================================
All tests passed
(
3343
239 assertions
in
28
test
cases
)
All tests passed
(
3343
318 assertions
in
29
test
cases
)
```
For more information, have a look at the file
[
.travis.yml
](
https://github.com/nlohmann/json/blob/master/.travis.yml
)
.
src/json.hpp
View file @
600ad330
This diff is collapsed.
Click to expand it.
src/json.hpp.re2c
View file @
600ad330
...
...
@@ -2671,14 +2671,14 @@ class basic_json
@since version 1.0.0
*/
template
<
typename ValueType, typename
std::enable_if
<
not std::is_pointer<ValueType>::value
and not std::is_same<ValueType, typename string_t::value_type>::value
template
<
typename ValueType, typename
std::enable_if
<
not std::is_pointer<ValueType>::value
and not std::is_same<ValueType, typename string_t::value_type>::value
#ifndef _MSC_VER // Fix for issue #167 operator<< abiguity 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
, int>::type = 0
>
, int >::type = 0
>
operator ValueType() const
{
// delegate the call to get<>() const
...
...
@@ -3081,7 +3081,7 @@ class basic_json
@since version 1.0.0
*/
template<typename T, std::size_t n>
reference operator[](T* (&key)[n])
reference operator[](T
* (&key)[n])
{
return operator[](static_cast<const T>(key));
}
...
...
@@ -3116,7 +3116,7 @@ class basic_json
@since version 1.0.0
*/
template<typename T, std::size_t n>
const_reference operator[](T* (&key)[n]) const
const_reference operator[](T
* (&key)[n]) const
{
return operator[](static_cast<const T>(key));
}
...
...
test/unit.cpp
View file @
600ad330
...
...
@@ -11500,12 +11500,12 @@ TEST_CASE("regression tests")
CHECK
(
s2
==
"value"
);
}
SECTION
(
"character following a surrogate pair is skipped"
)
SECTION
(
"
issue #146 -
character following a surrogate pair is skipped"
)
{
CHECK
(
json
::
parse
(
"
\"\\
ud80c
\\
udc60abc
\"
"
).
get
<
json
::
string_t
>
()
==
u8"\U00013060abc"
);
}
SECTION
(
"issue #1
44
- Cannot index by key of type static constexpr const char*"
)
SECTION
(
"issue #1
71
- Cannot index by key of type static constexpr const char*"
)
{
json
j
;
...
...
@@ -11521,12 +11521,12 @@ TEST_CASE("regression tests")
// Non-const access with key as "char *"
char
_ptr_key
[]
=
"Key3"
;
char
*
ptr_key
=
&
_ptr_key
[
0
];
char
*
ptr_key
=
&
_ptr_key
[
0
];
CHECK_NOTHROW
(
j
[
ptr_key
]
=
3
);
CHECK
(
j
[
ptr_key
]
==
json
(
3
));
// Non-const access with key as "const char *"
const
char
*
const_ptr_key
=
"Key4"
;
const
char
*
const_ptr_key
=
"Key4"
;
CHECK_NOTHROW
(
j
[
const_ptr_key
]
=
4
);
CHECK
(
j
[
const_ptr_key
]
==
json
(
4
));
...
...
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