C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Proposal: Making The auto Keyword Optional in Trailing Return Types

From: Jan Schultke <janschultke_at_[hidden]>
Date: Wed, 19 Mar 2025 11:16:23 +0100
It sucks that the syntax is "auto" rather than "fn", but that's
ultimately what we're stuck with.

It's not realistic to drop the keywords entirely because you then need
arbitrary lookahead parsing to figure out if you're parsing a function
call or declaration. This is only fine for constructor declarations,
that are never
ambiguous with function calls anyway.

Even if you solved this problem, you'd just be creating a new syntax
that expresses something we can already express, and that's by default
not worth committee time. It only saves you four characters anyway.

Received on 2025-03-19 10:16:40