C++ Logo

SG7

Advanced search

Subject: Re: Metaprogramming
From: Andrew Sutton (asutton.list_at_[hidden])
Date: 2020-10-26 12:20:58


>
> 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



SG7 list run by sg7-owner@lists.isocpp.org

Older Archives on Google Groups