Date: Mon, 26 Oct 2020 13:20:58 -0400
>
> To summarize my position: I support expanding `|# ... #|` (which also has
> the problem that the generated identifier may not be determined to be
> semantically valid until instantiation, or am I missing something?) to
> allow string injections in as many contexts as possible, to help the user
> to specify precisely what is dependent in their metafunctions, and
> precisely what is not, up to and including full statements and declarations
> should it ever be necessary.
>
Yes, the identifier splice operator is an explicit mechanism for
creating unhygienic fragments. It's also the smallest possible facility
that does so. There are some use cases where inventing new identifiers is
necessary. That said, if we found ways to avoid requiring the operator, I
would happily kill it. It's been the single hardest aspect of the
implementation, IIRC.
Just to be clear, I'm not strongly against a facility that turns strings
into code. I think that making that the foundation of metaprogramming is
the wrong choice for C++.
Andrew
> To summarize my position: I support expanding `|# ... #|` (which also has
> the problem that the generated identifier may not be determined to be
> semantically valid until instantiation, or am I missing something?) to
> allow string injections in as many contexts as possible, to help the user
> to specify precisely what is dependent in their metafunctions, and
> precisely what is not, up to and including full statements and declarations
> should it ever be necessary.
>
Yes, the identifier splice operator is an explicit mechanism for
creating unhygienic fragments. It's also the smallest possible facility
that does so. There are some use cases where inventing new identifiers is
necessary. That said, if we found ways to avoid requiring the operator, I
would happily kill it. It's been the single hardest aspect of the
implementation, IIRC.
Just to be clear, I'm not strongly against a facility that turns strings
into code. I think that making that the foundation of metaprogramming is
the wrong choice for C++.
Andrew
Received on 2020-10-26 12:21:12