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
972c15f2
Unverified
Commit
972c15f2
authored
Dec 07, 2020
by
Krylov Yaroslav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ordered_map::insert(InputIt first, InputIt last) is added
parent
5155cc2c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
include/nlohmann/ordered_map.hpp
include/nlohmann/ordered_map.hpp
+13
-0
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+13
-0
No files found.
include/nlohmann/ordered_map.hpp
View file @
972c15f2
...
...
@@ -168,6 +168,19 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
Container
::
push_back
(
value
);
return
{
--
this
->
end
(),
true
};
}
template
<
typename
InputIt
>
using
require_input_iter
=
typename
std
::
enable_if
<
std
::
is_convertible
<
typename
std
::
iterator_traits
<
InputIt
>::
iterator_category
,
std
::
input_iterator_tag
>::
value
>::
type
;
template
<
typename
InputIt
,
typename
=
require_input_iter
<
InputIt
>
>
void
insert
(
InputIt
first
,
InputIt
last
)
{
for
(
auto
it
=
first
;
it
!=
last
;
++
it
)
{
insert
(
*
it
);
}
}
};
}
// namespace nlohmann
single_include/nlohmann/json.hpp
View file @
972c15f2
...
...
@@ -16634,6 +16634,19 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
Container::push_back(value);
return {--this->end(), true};
}
template<typename InputIt>
using require_input_iter = typename std::enable_if<std::is_convertible<typename std::iterator_traits<InputIt>::iterator_category,
std::input_iterator_tag>::value>::type;
template<typename InputIt, typename = require_input_iter<InputIt>>
void insert(InputIt first, InputIt last)
{
for (auto it = first; it != last; ++it)
{
insert(*it);
}
}
};
} // 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