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
8c2b26de
Unverified
Commit
8c2b26de
authored
May 07, 2020
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
⚗
do not include <ciso646> with C++20 #2089
parent
9adb1c02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
49 deletions
+45
-49
boolean_operators.hpp
include/nlohmann/detail/boolean_operators.hpp
+2
-6
json.hpp
single_include/nlohmann/json.hpp
+43
-43
No files found.
include/nlohmann/detail/boolean_operators.hpp
View file @
8c2b26de
#pragma once
#pragma once
#include <nlohmann/detail/macro_scope.hpp>
// Header <ciso646> is removed in C++20.
// Header <ciso646> is needed for older MSVC versions to allow to use the
// alternative operator representations "and", "or", and "not". As the header
// is removed in C++20, we must only include it for old MSVC versions.
// See <https://github.com/nlohmann/json/issues/2089> for more information.
// See <https://github.com/nlohmann/json/issues/2089> for more information.
#if
!JSON_HEDLEY_MSVC_VERSION_CHECK(15,5,0)
#if
__cplusplus <= 201703L
#include <ciso646> // and, not, or
#include <ciso646> // and, not, or
#endif
#endif
single_include/nlohmann/json.hpp
View file @
8c2b26de
...
@@ -70,6 +70,49 @@ SOFTWARE.
...
@@ -70,6 +70,49 @@ SOFTWARE.
// #include <nlohmann/detail/boolean_operators.hpp>
// #include <nlohmann/detail/boolean_operators.hpp>
// Header <ciso646> is removed in C++20.
// See <https://github.com/nlohmann/json/issues/2089> for more information.
#if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif
// #include <nlohmann/detail/exceptions.hpp>
#include <exception> // exception
#include <stdexcept> // runtime_error
#include <string> // to_string
// #include <nlohmann/detail/input/position_t.hpp>
#include <cstddef> // size_t
namespace
nlohmann
{
namespace
detail
{
/// struct to capture the start position of the current token
struct
position_t
{
/// the total number of characters read
std
::
size_t
chars_read_total
=
0
;
/// the number of characters read in the current line
std
::
size_t
chars_read_current_line
=
0
;
/// the number of lines read
std
::
size_t
lines_read
=
0
;
/// conversion to size_t to preserve SAX interface
constexpr
operator
size_t
()
const
{
return
chars_read_total
;
}
};
}
// namespace detail
}
// namespace nlohmann
// #include <nlohmann/detail/macro_scope.hpp>
// #include <nlohmann/detail/macro_scope.hpp>
...
@@ -2107,49 +2150,6 @@ JSON_HEDLEY_DIAGNOSTIC_POP
...
@@ -2107,49 +2150,6 @@ JSON_HEDLEY_DIAGNOSTIC_POP
AllocatorType, JSONSerializer, BinaryType>
AllocatorType, JSONSerializer, BinaryType>
#if !JSON_HEDLEY_MSVC_VERSION_CHECK(15,5,0)
#include <ciso646> // and, not, or
#endif
// #include <nlohmann/detail/exceptions.hpp>
#include <exception> // exception
#include <stdexcept> // runtime_error
#include <string> // to_string
// #include <nlohmann/detail/input/position_t.hpp>
#include <cstddef> // size_t
namespace
nlohmann
{
namespace
detail
{
/// struct to capture the start position of the current token
struct
position_t
{
/// the total number of characters read
std
::
size_t
chars_read_total
=
0
;
/// the number of characters read in the current line
std
::
size_t
chars_read_current_line
=
0
;
/// the number of lines read
std
::
size_t
lines_read
=
0
;
/// conversion to size_t to preserve SAX interface
constexpr
operator
size_t
()
const
{
return
chars_read_total
;
}
};
}
// namespace detail
}
// namespace nlohmann
// #include <nlohmann/detail/macro_scope.hpp>
namespace
nlohmann
namespace
nlohmann
{
{
namespace
detail
namespace
detail
...
...
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