C++ Logo

std-proposals

Advanced search

Re: [std-proposals] allowing unicode rightarrow as a substitute for ->

From: Tom Honermann <tom_at_[hidden]>
Date: Fri, 20 Jan 2023 10:23:46 -0500
On 1/20/23 9:31 AM, Gergely Nagy via Std-Proposals wrote:
> Absolutely not. But you can, if you want
>
> #define → ->
>
> And you are set.

Actually, no. Per [cpp.pre] <http://eel.is/c++draft/cpp.pre>, macro
names are required to be identifiers and, per [lex.name]
<http://eel.is/c++draft/lex.name>, U+2192 (RIGHTWARDS ARROW) is not
among the characters that are allowed in identifiers, even prior to the
acceptance of P1949 <https://wg21.link/p1949> for C++ and N2836
<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2836.pdf> for C. As
can be seen here
<https://util.unicode.org/UnicodeJsps/character.jsp?a=%E2%86%92&B1=Show>,
that character does not have the XID_Start
<https://util.unicode.org/UnicodeJsps/properties.jsp?a=XID_Start#XID_Start>
property.

We might eventually want to adopt a subset of such non-identifier
characters for use as operators in C and C++ and, perhaps as part of a
more encompassing proposal, it would make sense to dedicate this
character as an alias of the -> operator if only to prevent it from
being used for other purposes. But I think this proposal on its own
lacks sufficient motivation at this time.

Tom.

>
>
> On Fri, Jan 20, 2023, 08:05 Julien Allali via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>
> Dear all,
>
> Even if it looks anecdotal, I would like to suggest support for
> unicode
> right arrow character → as a valid substitution for ->.
>
> best,
>
> Julien.
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
>

Received on 2023-01-20 15:23:47