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
d21d2983
Unverified
Commit
d21d2983
authored
Mar 28, 2019
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
fixed indentation
parent
23635704
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
101 additions
and
99 deletions
+101
-99
include/nlohmann/detail/iterators/iterator_traits.hpp
include/nlohmann/detail/iterators/iterator_traits.hpp
+17
-15
include/nlohmann/detail/meta/is_sax.hpp
include/nlohmann/detail/meta/is_sax.hpp
+84
-84
No files found.
include/nlohmann/detail/iterators/iterator_traits.hpp
View file @
d21d2983
...
...
@@ -13,15 +13,16 @@ template <typename It, typename = void>
struct
iterator_types
{};
template
<
typename
It
>
struct
iterator_types
<
struct
iterator_types
<
It
,
void_t
<
typename
It
::
difference_type
,
typename
It
::
value_type
,
typename
It
::
pointer
,
typename
It
::
reference
,
typename
It
::
iterator_category
>>
{
using
difference_type
=
typename
It
::
difference_type
;
using
value_type
=
typename
It
::
value_type
;
using
pointer
=
typename
It
::
pointer
;
using
reference
=
typename
It
::
reference
;
using
iterator_category
=
typename
It
::
iterator_category
;
typename
It
::
reference
,
typename
It
::
iterator_category
>>
{
using
difference_type
=
typename
It
::
difference_type
;
using
value_type
=
typename
It
::
value_type
;
using
pointer
=
typename
It
::
pointer
;
using
reference
=
typename
It
::
reference
;
using
iterator_category
=
typename
It
::
iterator_category
;
};
// This is required as some compilers implement std::iterator_traits in a way that
...
...
@@ -32,18 +33,19 @@ struct iterator_traits
};
template
<
typename
T
>
struct
iterator_traits
<
T
,
enable_if_t
<!
std
::
is_pointer
<
T
>::
value
>>
:
iterator_types
<
T
>
struct
iterator_traits
<
T
,
enable_if_t
<
!
std
::
is_pointer
<
T
>::
value
>>
:
iterator_types
<
T
>
{
};
template
<
typename
T
>
struct
iterator_traits
<
T
*
,
enable_if_t
<
std
::
is_object
<
T
>::
value
>>
{
using
iterator_category
=
std
::
random_access_iterator_tag
;
using
value_type
=
T
;
using
difference_type
=
ptrdiff_t
;
using
pointer
=
T
*
;
using
reference
=
T
&
;
struct
iterator_traits
<
T
*
,
enable_if_t
<
std
::
is_object
<
T
>::
value
>>
{
using
iterator_category
=
std
::
random_access_iterator_tag
;
using
value_type
=
T
;
using
difference_type
=
ptrdiff_t
;
using
pointer
=
T
*
;
using
reference
=
T
&
;
};
}
// namespace detail
}
// namespace nlohmann
include/nlohmann/detail/meta/is_sax.hpp
View file @
d21d2983
...
...
@@ -24,119 +24,119 @@ using number_integer_function_t =
template
<
typename
T
,
typename
Unsigned
>
using
number_unsigned_function_t
=
decltype
(
std
::
declval
<
T
&>
().
number_unsigned
(
std
::
declval
<
Unsigned
>
()));
decltype
(
std
::
declval
<
T
&>
().
number_unsigned
(
std
::
declval
<
Unsigned
>
()));
template
<
typename
T
,
typename
Float
,
typename
String
>
using
number_float_function_t
=
decltype
(
std
::
declval
<
T
&>
().
number_float
(
std
::
declval
<
Float
>
(),
std
::
declval
<
const
String
&>
()));
using
number_float_function_t
=
decltype
(
std
::
declval
<
T
&>
().
number_float
(
std
::
declval
<
Float
>
(),
std
::
declval
<
const
String
&>
()));
template
<
typename
T
,
typename
String
>
using
string_function_t
=
decltype
(
std
::
declval
<
T
&>
().
string
(
std
::
declval
<
String
&>
()));
decltype
(
std
::
declval
<
T
&>
().
string
(
std
::
declval
<
String
&>
()));
template
<
typename
T
>
using
start_object_function_t
=
decltype
(
std
::
declval
<
T
&>
().
start_object
(
std
::
declval
<
std
::
size_t
>
()));
decltype
(
std
::
declval
<
T
&>
().
start_object
(
std
::
declval
<
std
::
size_t
>
()));
template
<
typename
T
,
typename
String
>
using
key_function_t
=
decltype
(
std
::
declval
<
T
&>
().
key
(
std
::
declval
<
String
&>
()));
decltype
(
std
::
declval
<
T
&>
().
key
(
std
::
declval
<
String
&>
()));
template
<
typename
T
>
using
end_object_function_t
=
decltype
(
std
::
declval
<
T
&>
().
end_object
());
using
end_object_function_t
=
decltype
(
std
::
declval
<
T
&>
().
end_object
());
template
<
typename
T
>
using
start_array_function_t
=
decltype
(
std
::
declval
<
T
&>
().
start_array
(
std
::
declval
<
std
::
size_t
>
()));
decltype
(
std
::
declval
<
T
&>
().
start_array
(
std
::
declval
<
std
::
size_t
>
()));
template
<
typename
T
>
using
end_array_function_t
=
decltype
(
std
::
declval
<
T
&>
().
end_array
());
using
end_array_function_t
=
decltype
(
std
::
declval
<
T
&>
().
end_array
());
template
<
typename
T
,
typename
Exception
>
using
parse_error_function_t
=
decltype
(
std
::
declval
<
T
&>
().
parse_error
(
std
::
declval
<
std
::
size_t
>
(),
std
::
declval
<
const
std
::
string
&>
(),
std
::
declval
<
const
Exception
&>
()));
using
parse_error_function_t
=
decltype
(
std
::
declval
<
T
&>
().
parse_error
(
std
::
declval
<
std
::
size_t
>
(),
std
::
declval
<
const
std
::
string
&>
(),
std
::
declval
<
const
Exception
&>
()));
template
<
typename
SAX
,
typename
BasicJsonType
>
struct
is_sax
{
private:
static_assert
(
is_basic_json
<
BasicJsonType
>::
value
,
"BasicJsonType must be of type basic_json<...>"
);
using
number_integer_t
=
typename
BasicJsonType
::
number_integer_t
;
using
number_unsigned_t
=
typename
BasicJsonType
::
number_unsigned_t
;
using
number_float_t
=
typename
BasicJsonType
::
number_float_t
;
using
string_t
=
typename
BasicJsonType
::
string_t
;
using
exception_t
=
typename
BasicJsonType
::
exception
;
public:
static
constexpr
bool
value
=
is_detected_exact
<
bool
,
null_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
boolean_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
number_integer_function_t
,
SAX
,
number_integer_t
>::
value
&&
is_detected_exact
<
bool
,
number_unsigned_function_t
,
SAX
,
number_unsigned_t
>::
value
&&
is_detected_exact
<
bool
,
number_float_function_t
,
SAX
,
number_float_t
,
string_t
>::
value
&&
is_detected_exact
<
bool
,
string_function_t
,
SAX
,
string_t
>::
value
&&
is_detected_exact
<
bool
,
start_object_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
key_function_t
,
SAX
,
string_t
>::
value
&&
is_detected_exact
<
bool
,
end_object_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
start_array_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
end_array_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
parse_error_function_t
,
SAX
,
exception_t
>::
value
;
private:
static_assert
(
is_basic_json
<
BasicJsonType
>::
value
,
"BasicJsonType must be of type basic_json<...>"
);
using
number_integer_t
=
typename
BasicJsonType
::
number_integer_t
;
using
number_unsigned_t
=
typename
BasicJsonType
::
number_unsigned_t
;
using
number_float_t
=
typename
BasicJsonType
::
number_float_t
;
using
string_t
=
typename
BasicJsonType
::
string_t
;
using
exception_t
=
typename
BasicJsonType
::
exception
;
public:
static
constexpr
bool
value
=
is_detected_exact
<
bool
,
null_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
boolean_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
number_integer_function_t
,
SAX
,
number_integer_t
>::
value
&&
is_detected_exact
<
bool
,
number_unsigned_function_t
,
SAX
,
number_unsigned_t
>::
value
&&
is_detected_exact
<
bool
,
number_float_function_t
,
SAX
,
number_float_t
,
string_t
>::
value
&&
is_detected_exact
<
bool
,
string_function_t
,
SAX
,
string_t
>::
value
&&
is_detected_exact
<
bool
,
start_object_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
key_function_t
,
SAX
,
string_t
>::
value
&&
is_detected_exact
<
bool
,
end_object_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
start_array_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
end_array_function_t
,
SAX
>::
value
&&
is_detected_exact
<
bool
,
parse_error_function_t
,
SAX
,
exception_t
>::
value
;
};
template
<
typename
SAX
,
typename
BasicJsonType
>
struct
is_sax_static_asserts
{
private:
static_assert
(
is_basic_json
<
BasicJsonType
>::
value
,
"BasicJsonType must be of type basic_json<...>"
);
using
number_integer_t
=
typename
BasicJsonType
::
number_integer_t
;
using
number_unsigned_t
=
typename
BasicJsonType
::
number_unsigned_t
;
using
number_float_t
=
typename
BasicJsonType
::
number_float_t
;
using
string_t
=
typename
BasicJsonType
::
string_t
;
using
exception_t
=
typename
BasicJsonType
::
exception
;
public:
static_assert
(
is_detected_exact
<
bool
,
null_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool null()"
);
static_assert
(
is_detected_exact
<
bool
,
boolean_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool boolean(bool)"
);
static_assert
(
is_detected_exact
<
bool
,
boolean_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool boolean(bool)"
);
static_assert
(
is_detected_exact
<
bool
,
number_integer_function_t
,
SAX
,
number_integer_t
>::
value
,
"Missing/invalid function: bool number_integer(number_integer_t)"
);
static_assert
(
is_detected_exact
<
bool
,
number_unsigned_function_t
,
SAX
,
number_unsigned_t
>::
value
,
"Missing/invalid function: bool number_unsigned(number_unsigned_t)"
);
static_assert
(
is_detected_exact
<
bool
,
number_float_function_t
,
SAX
,
number_float_t
,
string_t
>::
value
,
"Missing/invalid function: bool number_float(number_float_t, const string_t&)"
);
static_assert
(
is_detected_exact
<
bool
,
string_function_t
,
SAX
,
string_t
>::
value
,
"Missing/invalid function: bool string(string_t&)"
);
static_assert
(
is_detected_exact
<
bool
,
start_object_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool start_object(std::size_t)"
);
static_assert
(
is_detected_exact
<
bool
,
key_function_t
,
SAX
,
string_t
>::
value
,
"Missing/invalid function: bool key(string_t&)"
);
static_assert
(
is_detected_exact
<
bool
,
end_object_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool end_object()"
);
static_assert
(
is_detected_exact
<
bool
,
start_array_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool start_array(std::size_t)"
);
static_assert
(
is_detected_exact
<
bool
,
end_array_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool end_array()"
);
static_assert
(
is_detected_exact
<
bool
,
parse_error_function_t
,
SAX
,
exception_t
>::
value
,
"Missing/invalid function: bool parse_error(std::size_t, const "
"std::string&, const exception&)"
);
private:
static_assert
(
is_basic_json
<
BasicJsonType
>::
value
,
"BasicJsonType must be of type basic_json<...>"
);
using
number_integer_t
=
typename
BasicJsonType
::
number_integer_t
;
using
number_unsigned_t
=
typename
BasicJsonType
::
number_unsigned_t
;
using
number_float_t
=
typename
BasicJsonType
::
number_float_t
;
using
string_t
=
typename
BasicJsonType
::
string_t
;
using
exception_t
=
typename
BasicJsonType
::
exception
;
public:
static_assert
(
is_detected_exact
<
bool
,
null_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool null()"
);
static_assert
(
is_detected_exact
<
bool
,
boolean_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool boolean(bool)"
);
static_assert
(
is_detected_exact
<
bool
,
boolean_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool boolean(bool)"
);
static_assert
(
is_detected_exact
<
bool
,
number_integer_function_t
,
SAX
,
number_integer_t
>::
value
,
"Missing/invalid function: bool number_integer(number_integer_t)"
);
static_assert
(
is_detected_exact
<
bool
,
number_unsigned_function_t
,
SAX
,
number_unsigned_t
>::
value
,
"Missing/invalid function: bool number_unsigned(number_unsigned_t)"
);
static_assert
(
is_detected_exact
<
bool
,
number_float_function_t
,
SAX
,
number_float_t
,
string_t
>::
value
,
"Missing/invalid function: bool number_float(number_float_t, const string_t&)"
);
static_assert
(
is_detected_exact
<
bool
,
string_function_t
,
SAX
,
string_t
>::
value
,
"Missing/invalid function: bool string(string_t&)"
);
static_assert
(
is_detected_exact
<
bool
,
start_object_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool start_object(std::size_t)"
);
static_assert
(
is_detected_exact
<
bool
,
key_function_t
,
SAX
,
string_t
>::
value
,
"Missing/invalid function: bool key(string_t&)"
);
static_assert
(
is_detected_exact
<
bool
,
end_object_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool end_object()"
);
static_assert
(
is_detected_exact
<
bool
,
start_array_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool start_array(std::size_t)"
);
static_assert
(
is_detected_exact
<
bool
,
end_array_function_t
,
SAX
>::
value
,
"Missing/invalid function: bool end_array()"
);
static_assert
(
is_detected_exact
<
bool
,
parse_error_function_t
,
SAX
,
exception_t
>::
value
,
"Missing/invalid function: bool parse_error(std::size_t, const "
"std::string&, const exception&)"
);
};
}
// namespace detail
}
// namespace nlohmann
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