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
69d74d4e
Unverified
Commit
69d74d4e
authored
Mar 30, 2021
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
♻
clean up
parent
f359d74e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
187 deletions
+80
-187
erase.md
doc/mkdocs/docs/api/basic_json/erase.md
+2
-3
type_traits.hpp
include/nlohmann/detail/meta/type_traits.hpp
+12
-0
json.hpp
include/nlohmann/json.hpp
+27
-92
json.hpp
single_include/nlohmann/json.hpp
+39
-92
No files found.
doc/mkdocs/docs/api/basic_json/erase.md
View file @
69d74d4e
...
@@ -12,7 +12,6 @@ const_iterator erase(const_iterator first, const_iterator last);
...
@@ -12,7 +12,6 @@ const_iterator erase(const_iterator first, const_iterator last);
// (3)
// (3)
template
<
typename
KeyT
>
template
<
typename
KeyT
>
size_type
erase
(
KeyT
&&
key
);
size_type
erase
(
KeyT
&&
key
);
size_type
erase
(
const
std
::
string_view
&
key
);
// since C++17
// (4)
// (4)
void
erase
(
const
size_type
idx
);
void
erase
(
const
size_type
idx
);
...
@@ -36,7 +35,7 @@ void erase(const size_type idx);
...
@@ -36,7 +35,7 @@ void erase(const size_type idx);
## Template parameters
## Template parameters
`KeyT`
`KeyT`
: A type convertible to an object key. This can also be a string literal.
: A type convertible to an object key. This can also be a string literal
or a string view (C++17)
.
## Parameters
## Parameters
...
@@ -182,4 +181,4 @@ Strong exception safety: if an exception occurs, the original value stays intact
...
@@ -182,4 +181,4 @@ Strong exception safety: if an exception occurs, the original value stays intact
-
Added in version 1.0.0.
-
Added in version 1.0.0.
-
Added support for binary types in version 3.8.0.
-
Added support for binary types in version 3.8.0.
-
Added
`KeyT`
template
and overload for
`std::string_view`
in version 3.10.0.
-
Added
`KeyT`
template in version 3.10.0.
include/nlohmann/detail/meta/type_traits.hpp
View file @
69d74d4e
...
@@ -394,5 +394,17 @@ struct is_constructible_tuple : std::false_type {};
...
@@ -394,5 +394,17 @@ struct is_constructible_tuple : std::false_type {};
template
<
typename
T1
,
typename
...
Args
>
template
<
typename
T1
,
typename
...
Args
>
struct
is_constructible_tuple
<
T1
,
std
::
tuple
<
Args
...
>>
:
conjunction
<
std
::
is_constructible
<
T1
,
Args
>
...
>
{};
struct
is_constructible_tuple
<
T1
,
std
::
tuple
<
Args
...
>>
:
conjunction
<
std
::
is_constructible
<
T1
,
Args
>
...
>
{};
/// type to check if KeyType can be used as object key
template
<
typename
BasicJsonType
,
typename
KeyType
>
struct
is_key_type
{
static
constexpr
bool
value
=
#if defined(JSON_HAS_CPP_17)
std
::
is_same
<
typename
std
::
decay
<
KeyType
>::
type
,
std
::
string_view
>::
value
||
#endif
std
::
is_convertible
<
KeyType
,
typename
BasicJsonType
::
object_t
::
key_type
>::
value
;
};
}
// namespace detail
}
// namespace detail
}
// namespace nlohmann
}
// namespace nlohmann
include/nlohmann/json.hpp
View file @
69d74d4e
This diff is collapsed.
Click to expand it.
single_include/nlohmann/json.hpp
View file @
69d74d4e
This diff is collapsed.
Click to expand it.
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