Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
8da58da5
Unverified
Commit
8da58da5
authored
May 28, 2022
by
Aaron Gokaslan
Committed by
GitHub
May 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: perfectly forward all make_iterator args (#3980)
* Perfectly forward all make_iterator args * Try emplace back
parent
748ae227
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
include/pybind11/pybind11.h
+15
-9
No files found.
include/pybind11/pybind11.h
View file @
8da58da5
...
...
@@ -2333,7 +2333,7 @@ template <typename Access,
typename
Sentinel
,
typename
ValueType
,
typename
...
Extra
>
iterator
make_iterator_impl
(
Iterator
first
,
Sentinel
last
,
Extra
&&
...
extra
)
{
iterator
make_iterator_impl
(
Iterator
&&
first
,
Sentinel
&&
last
,
Extra
&&
...
extra
)
{
using
state
=
detail
::
iterator_state
<
Access
,
Policy
,
Iterator
,
Sentinel
,
ValueType
,
Extra
...
>
;
// TODO: state captures only the types of Extra, not the values
...
...
@@ -2359,7 +2359,7 @@ iterator make_iterator_impl(Iterator first, Sentinel last, Extra &&...extra) {
Policy
);
}
return
cast
(
state
{
first
,
last
,
true
});
return
cast
(
state
{
std
::
forward
<
Iterator
>
(
first
),
std
::
forward
<
Sentinel
>
(
last
)
,
true
});
}
PYBIND11_NAMESPACE_END
(
detail
)
...
...
@@ -2370,13 +2370,15 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
typename
Sentinel
,
typename
ValueType
=
typename
detail
::
iterator_access
<
Iterator
>::
result_type
,
typename
...
Extra
>
iterator
make_iterator
(
Iterator
first
,
Sentinel
last
,
Extra
&&
...
extra
)
{
iterator
make_iterator
(
Iterator
&&
first
,
Sentinel
&&
last
,
Extra
&&
...
extra
)
{
return
detail
::
make_iterator_impl
<
detail
::
iterator_access
<
Iterator
>
,
Policy
,
Iterator
,
Sentinel
,
ValueType
,
Extra
...
>
(
first
,
last
,
std
::
forward
<
Extra
>
(
extra
)...);
Extra
...
>
(
std
::
forward
<
Iterator
>
(
first
),
std
::
forward
<
Sentinel
>
(
last
),
std
::
forward
<
Extra
>
(
extra
)...);
}
/// Makes a python iterator over the keys (`.first`) of a iterator over pairs from a
...
...
@@ -2386,13 +2388,15 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
typename
Sentinel
,
typename
KeyType
=
typename
detail
::
iterator_key_access
<
Iterator
>::
result_type
,
typename
...
Extra
>
iterator
make_key_iterator
(
Iterator
first
,
Sentinel
last
,
Extra
&&
...
extra
)
{
iterator
make_key_iterator
(
Iterator
&&
first
,
Sentinel
&&
last
,
Extra
&&
...
extra
)
{
return
detail
::
make_iterator_impl
<
detail
::
iterator_key_access
<
Iterator
>
,
Policy
,
Iterator
,
Sentinel
,
KeyType
,
Extra
...
>
(
first
,
last
,
std
::
forward
<
Extra
>
(
extra
)...);
Extra
...
>
(
std
::
forward
<
Iterator
>
(
first
),
std
::
forward
<
Sentinel
>
(
last
),
std
::
forward
<
Extra
>
(
extra
)...);
}
/// Makes a python iterator over the values (`.second`) of a iterator over pairs from a
...
...
@@ -2402,13 +2406,15 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
typename
Sentinel
,
typename
ValueType
=
typename
detail
::
iterator_value_access
<
Iterator
>::
result_type
,
typename
...
Extra
>
iterator
make_value_iterator
(
Iterator
first
,
Sentinel
last
,
Extra
&&
...
extra
)
{
iterator
make_value_iterator
(
Iterator
&&
first
,
Sentinel
&&
last
,
Extra
&&
...
extra
)
{
return
detail
::
make_iterator_impl
<
detail
::
iterator_value_access
<
Iterator
>
,
Policy
,
Iterator
,
Sentinel
,
ValueType
,
Extra
...
>
(
first
,
last
,
std
::
forward
<
Extra
>
(
extra
)...);
Extra
...
>
(
std
::
forward
<
Iterator
>
(
first
),
std
::
forward
<
Sentinel
>
(
last
),
std
::
forward
<
Extra
>
(
extra
)...);
}
/// Makes an iterator over values of an stl container or other container supporting
...
...
@@ -2467,7 +2473,7 @@ void implicitly_convertible() {
};
if
(
auto
*
tinfo
=
detail
::
get_type_info
(
typeid
(
OutputType
)))
{
tinfo
->
implicit_conversions
.
push_back
(
implicit_caster
);
tinfo
->
implicit_conversions
.
emplace_back
(
std
::
move
(
implicit_caster
)
);
}
else
{
pybind11_fail
(
"implicitly_convertible: Unable to find type "
+
type_id
<
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