Date: Fri, 18 Sep 2026 08:36:53 +0000
On Friday, September 18th, 2026 at 10:15 AM, Jan Schultke via Std-Proposals <std-proposals_at_[hidden]> wrote:
> Can you come up with an example where this feature would be genuinely useful?
One place I'd find it useful is when taking a user-provided function,
like a projection or a comparison function, that has a sensible default.
Today I have to write:
template<ranges::range R, class Proj = std::identity>
void foo(R&& r, Proj proj = {});
But I'd rather write:
void foo(ranges::range auto&& r, auto proj = std::identity());
> Can you come up with an example where this feature would be genuinely useful?
One place I'd find it useful is when taking a user-provided function,
like a projection or a comparison function, that has a sensible default.
Today I have to write:
template<ranges::range R, class Proj = std::identity>
void foo(R&& r, Proj proj = {});
But I'd rather write:
void foo(ranges::range auto&& r, auto proj = std::identity());
Received on 2026-09-18 08:37:01
