Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
e3aa215b
Unverified
Commit
e3aa215b
authored
Apr 11, 2022
by
Aaron Gokaslan
Committed by
GitHub
Apr 11, 2022
Browse files
Add perfect forwarding to make_iterator calls (#3860)
parent
1b27b744
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+6
-3
No files found.
include/pybind11/pybind11.h
View file @
e3aa215b
...
@@ -2403,7 +2403,8 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
...
@@ -2403,7 +2403,8 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
typename
Type
,
typename
Type
,
typename
...
Extra
>
typename
...
Extra
>
iterator
make_iterator
(
Type
&
value
,
Extra
&&
...
extra
)
{
iterator
make_iterator
(
Type
&
value
,
Extra
&&
...
extra
)
{
return
make_iterator
<
Policy
>
(
std
::
begin
(
value
),
std
::
end
(
value
),
extra
...);
return
make_iterator
<
Policy
>
(
std
::
begin
(
value
),
std
::
end
(
value
),
std
::
forward
<
Extra
>
(
extra
)...);
}
}
/// Makes an iterator over the keys (`.first`) of a stl map-like container supporting
/// Makes an iterator over the keys (`.first`) of a stl map-like container supporting
...
@@ -2412,7 +2413,8 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
...
@@ -2412,7 +2413,8 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
typename
Type
,
typename
Type
,
typename
...
Extra
>
typename
...
Extra
>
iterator
make_key_iterator
(
Type
&
value
,
Extra
&&
...
extra
)
{
iterator
make_key_iterator
(
Type
&
value
,
Extra
&&
...
extra
)
{
return
make_key_iterator
<
Policy
>
(
std
::
begin
(
value
),
std
::
end
(
value
),
extra
...);
return
make_key_iterator
<
Policy
>
(
std
::
begin
(
value
),
std
::
end
(
value
),
std
::
forward
<
Extra
>
(
extra
)...);
}
}
/// Makes an iterator over the values (`.second`) of a stl map-like container supporting
/// Makes an iterator over the values (`.second`) of a stl map-like container supporting
...
@@ -2421,7 +2423,8 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
...
@@ -2421,7 +2423,8 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
typename
Type
,
typename
Type
,
typename
...
Extra
>
typename
...
Extra
>
iterator
make_value_iterator
(
Type
&
value
,
Extra
&&
...
extra
)
{
iterator
make_value_iterator
(
Type
&
value
,
Extra
&&
...
extra
)
{
return
make_value_iterator
<
Policy
>
(
std
::
begin
(
value
),
std
::
end
(
value
),
extra
...);
return
make_value_iterator
<
Policy
>
(
std
::
begin
(
value
),
std
::
end
(
value
),
std
::
forward
<
Extra
>
(
extra
)...);
}
}
template
<
typename
InputType
,
typename
OutputType
>
template
<
typename
InputType
,
typename
OutputType
>
...
...
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