C++ Logo


Advanced search

Re: Terse lambda quick outline of an alternative

From: Zhihao Yuan <zy_at_[hidden]>
Date: Thu, 27 Feb 2020 17:54:06 +0000
On Thursday, February 27, 2020 11:06 AM, Arthur O'Dwyer via Std-Proposals <std-proposals_at_[hidden]> wrote:

> the syntax []foo is frequently mentioned as a way of "lifting" an overload set into a lambda — that is, []foo should mean roughly [](auto&&... as) noexcept(noexcept(foo(FWD(as)...))) -> decltype(foo(FWD(as)...)) { return foo(FWD(as)...) }.
> std::transform(first, last, []std::toupper); // OK
> If you want to take the syntax []foo {}, you'd better be grabbing it for something that will be better than lifting. I don't think you are.

I don't know why lifting has to be in the syntax
[]foo, we can propose etaexpr(foo) if we find
that's useful.

Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.

Received on 2020-02-27 11:56:59