C++ Logo

std-proposals

Advanced search

Re: Function proposal: generic value_or

From: Gašper Ažman <gasper.azman_at_[hidden]>
Date: Wed, 7 Jul 2021 10:38:09 +0100
Ah yes, that failed, I remember. But would it still fail now that we have
fold expressions? The 'unevaluated' aspects of op? are very verbose to
emulate without additional language features.

On Wed, Jul 7, 2021 at 10:18 AM Ville Voutilainen <
ville.voutilainen_at_[hidden]> wrote:

> On Wed, 7 Jul 2021 at 12:02, Gašper Ažman via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
> >
> > How about proposing the elvis operator instead?
>
> That would be
> http://open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4120.pdf,
> which wasn't successful.
> It's not at all obvious to me why something like this should have a
> dedicated core language syntax,
> as opposed to having a utility function along the lines of what's
> suggested in this thread. The questions
> about a language change motivation and its costs and concerns attached
> to them don't really arise
> for a utility function.
>

Received on 2021-07-07 04:38:22