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
b2bec943
Unverified
Commit
b2bec943
authored
Nov 19, 2019
by
Niels Lohmann
Committed by
GitHub
Nov 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1846 from Mike-Bal/fix_warnings
Fix msvc warnings
parents
e7b3b40b
25e0175b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
include/nlohmann/detail/output/binary_writer.hpp
include/nlohmann/detail/output/binary_writer.hpp
+2
-2
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+2
-2
test/CMakeLists.txt
test/CMakeLists.txt
+1
-3
No files found.
include/nlohmann/detail/output/binary_writer.hpp
View file @
b2bec943
...
...
@@ -863,7 +863,7 @@ class binary_writer
{
std
::
size_t
array_index
=
0ul
;
const
std
::
size_t
embedded_document_size
=
std
::
accumulate
(
std
::
begin
(
value
),
std
::
end
(
value
),
0ul
,
[
&
array_index
](
std
::
size_t
result
,
const
typename
BasicJsonType
::
array_t
::
value_type
&
el
)
const
std
::
size_t
embedded_document_size
=
std
::
accumulate
(
std
::
begin
(
value
),
std
::
end
(
value
),
std
::
size_t
(
0
)
,
[
&
array_index
](
std
::
size_t
result
,
const
typename
BasicJsonType
::
array_t
::
value_type
&
el
)
{
return
result
+
calc_bson_element_size
(
std
::
to_string
(
array_index
++
),
el
);
});
...
...
@@ -984,7 +984,7 @@ class binary_writer
*/
static
std
::
size_t
calc_bson_object_size
(
const
typename
BasicJsonType
::
object_t
&
value
)
{
std
::
size_t
document_size
=
std
::
accumulate
(
value
.
begin
(),
value
.
end
(),
0ul
,
std
::
size_t
document_size
=
std
::
accumulate
(
value
.
begin
(),
value
.
end
(),
std
::
size_t
(
0
)
,
[](
size_t
result
,
const
typename
BasicJsonType
::
object_t
::
value_type
&
el
)
{
return
result
+=
calc_bson_element_size
(
el
.
first
,
el
.
second
);
...
...
single_include/nlohmann/json.hpp
View file @
b2bec943
...
...
@@ -12155,7 +12155,7 @@ class binary_writer
{
std
::
size_t
array_index
=
0ul
;
const
std
::
size_t
embedded_document_size
=
std
::
accumulate
(
std
::
begin
(
value
),
std
::
end
(
value
),
0ul
,
[
&
array_index
](
std
::
size_t
result
,
const
typename
BasicJsonType
::
array_t
::
value_type
&
el
)
const
std
::
size_t
embedded_document_size
=
std
::
accumulate
(
std
::
begin
(
value
),
std
::
end
(
value
),
std
::
size_t
(
0
)
,
[
&
array_index
](
std
::
size_t
result
,
const
typename
BasicJsonType
::
array_t
::
value_type
&
el
)
{
return
result
+
calc_bson_element_size
(
std
::
to_string
(
array_index
++
),
el
);
});
...
...
@@ -12276,7 +12276,7 @@ class binary_writer
*/
static
std
::
size_t
calc_bson_object_size
(
const
typename
BasicJsonType
::
object_t
&
value
)
{
std
::
size_t
document_size
=
std
::
accumulate
(
value
.
begin
(),
value
.
end
(),
0ul
,
std
::
size_t
document_size
=
std
::
accumulate
(
value
.
begin
(),
value
.
end
(),
std
::
size_t
(
0
)
,
[](
size_t
result
,
const
typename
BasicJsonType
::
object_t
::
value_type
&
el
)
{
return
result
+=
calc_bson_element_size
(
el
.
first
,
el
.
second
);
...
...
test/CMakeLists.txt
View file @
b2bec943
...
...
@@ -87,11 +87,9 @@ if(MSVC)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/W4"
)
endif
()
# Disable warning C4389: '==': signed/unsigned mismatch
# Disable warning C4309: 'static_cast': truncation of constant value
# Disable warning C4566: character represented by universal-character-name '\uFF01' cannot be represented in the current code page (1252)
# Disable warning C4996: 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::operator <<': was declared deprecated
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/wd4
389 /wd4309 /wd4
566 /wd4996"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/wd4566 /wd4996"
)
# https://github.com/nlohmann/json/issues/1114
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
/bigobj"
)
...
...
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