@@ -2333,7 +2333,7 @@ template <typename Access,
2333
2333
typename Sentinel,
2334
2334
typename ValueType,
2335
2335
typename ... Extra>
2336
- iterator make_iterator_impl (Iterator first, Sentinel last, Extra &&...extra ) {
2336
+ iterator make_iterator_impl (Iterator && first, Sentinel && last, Extra &&...extra ) {
2337
2337
using state = detail::iterator_state<Access, Policy, Iterator, Sentinel, ValueType, Extra...>;
2338
2338
// TODO: state captures only the types of Extra, not the values
2339
2339
@@ -2359,7 +2359,7 @@ iterator make_iterator_impl(Iterator first, Sentinel last, Extra &&...extra) {
2359
2359
Policy);
2360
2360
}
2361
2361
2362
- return cast (state{first, last, true });
2362
+ return cast (state{std::forward<Iterator>( first), std::forward<Sentinel>( last) , true });
2363
2363
}
2364
2364
2365
2365
PYBIND11_NAMESPACE_END (detail)
@@ -2370,13 +2370,15 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
2370
2370
typename Sentinel,
2371
2371
typename ValueType = typename detail::iterator_access<Iterator>::result_type,
2372
2372
typename ... Extra>
2373
- iterator make_iterator (Iterator first, Sentinel last, Extra &&...extra ) {
2373
+ iterator make_iterator (Iterator && first, Sentinel && last, Extra &&...extra ) {
2374
2374
return detail::make_iterator_impl<detail::iterator_access<Iterator>,
2375
2375
Policy,
2376
2376
Iterator,
2377
2377
Sentinel,
2378
2378
ValueType,
2379
- Extra...>(first, last, std::forward<Extra>(extra)...);
2379
+ Extra...>(std::forward<Iterator>(first),
2380
+ std::forward<Sentinel>(last),
2381
+ std::forward<Extra>(extra)...);
2380
2382
}
2381
2383
2382
2384
// / 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,
2386
2388
typename Sentinel,
2387
2389
typename KeyType = typename detail::iterator_key_access<Iterator>::result_type,
2388
2390
typename ... Extra>
2389
- iterator make_key_iterator (Iterator first, Sentinel last, Extra &&...extra ) {
2391
+ iterator make_key_iterator (Iterator && first, Sentinel && last, Extra &&...extra ) {
2390
2392
return detail::make_iterator_impl<detail::iterator_key_access<Iterator>,
2391
2393
Policy,
2392
2394
Iterator,
2393
2395
Sentinel,
2394
2396
KeyType,
2395
- Extra...>(first, last, std::forward<Extra>(extra)...);
2397
+ Extra...>(std::forward<Iterator>(first),
2398
+ std::forward<Sentinel>(last),
2399
+ std::forward<Extra>(extra)...);
2396
2400
}
2397
2401
2398
2402
// / 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,
2402
2406
typename Sentinel,
2403
2407
typename ValueType = typename detail::iterator_value_access<Iterator>::result_type,
2404
2408
typename ... Extra>
2405
- iterator make_value_iterator (Iterator first, Sentinel last, Extra &&...extra ) {
2409
+ iterator make_value_iterator (Iterator && first, Sentinel && last, Extra &&...extra ) {
2406
2410
return detail::make_iterator_impl<detail::iterator_value_access<Iterator>,
2407
2411
Policy,
2408
2412
Iterator,
2409
2413
Sentinel,
2410
2414
ValueType,
2411
- Extra...>(first, last, std::forward<Extra>(extra)...);
2415
+ Extra...>(std::forward<Iterator>(first),
2416
+ std::forward<Sentinel>(last),
2417
+ std::forward<Extra>(extra)...);
2412
2418
}
2413
2419
2414
2420
// / Makes an iterator over values of an stl container or other container supporting
@@ -2467,7 +2473,7 @@ void implicitly_convertible() {
2467
2473
};
2468
2474
2469
2475
if (auto *tinfo = detail::get_type_info (typeid (OutputType))) {
2470
- tinfo->implicit_conversions .push_back ( implicit_caster);
2476
+ tinfo->implicit_conversions .emplace_back ( std::move ( implicit_caster) );
2471
2477
} else {
2472
2478
pybind11_fail (" implicitly_convertible: Unable to find type " + type_id<OutputType>());
2473
2479
}
0 commit comments