On Jan 30, 2022, at 7:51 AM, Jonathan O'Connor via SG7 <sg7@lists.isocpp.org> wrote:Fellow elevator users,
Page 5:
In the discussion of `^f(x)` it is not clear if `f(x)` is evaluated.The sentence after the bullets describing what operands can be provided to the lifting operator says:
In the case where the name_or_postfix_expr is an expression, it is unevaluated but potentially constant evaluated.
From later discussion,
it would seem that it is evaluated if f(x) is constexpr. Presumably `^printf("hello")` is not evaluated.
The final paragraph does not mention applying the lift operator to a lambda.I’m not sure which final paragraph you’re referring to?In C++ lambda-expressions are expressions, and a lambda-expression is a postfix-expression (via primary-expression). So, yes, you can reflect a lambda-expression.(We don’t list every possible expansion of the grammar for purposes of conciseness.)Is
that possibility missing, or is it included as a class?I’m not sure what you mean by “is it included as a class?”. A lambda-expression is not a class, but it has class type. P1240 allows querying the type of an expression in general and so that includes lambda-expressions. So you can for example write:typename[: type_of(^[]{}) :] x;and that will produce a variable x of a closure type corresponding to that of the reflected lambda-expression.
Page 9: final code block:
There should be a comment on `^printf("Hello, ")` stating the printf function is not invoked
before the lift operator.It seems a bit redundant, but sure, I can add that. (Done in my version now.)Daveed
Regards,
Jonathan
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, January 15th, 2022 at 17:41, Daveed Vandevoorde via SG7 <sg7@lists.isocpp.org> wrote:SG7 mailing list--
SG7@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/sg7
SG7 mailing list
SG7@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/sg7