Skip to content

Commit 16c6db6

Browse files
committed
Remove explicit return type of the ranget::map function
Because infering the return type from the template parameters is a sizeable portion of the function implementation. So using an `auto` type tells the compiler that the type is in the return statement and saves us duplicating the same work in two places.
1 parent ea77c96 commit 16c6db6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/util/range.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,7 @@ struct ranget final
418418
/// a value through `f`. `f` may take a move-only typed parameter by const
419419
/// reference. 'f' may also construct and return a move-only typed value.
420420
template <typename functiont>
421-
auto map(functiont &&f) -> ranget<map_iteratort<
422-
iteratort,
423-
typename std::result_of<functiont(value_type)>::type>>
421+
auto map(functiont &&f)
424422
{
425423
using outputt = typename std::result_of<functiont(value_type)>::type;
426424
auto shared_f = std::make_shared<

0 commit comments

Comments
 (0)