Boost logo

Boost :

Subject: Re: [boost] [outcome] Ternary logic -- need an example
From: Peter Dimov (lists_at_[hidden])
Date: 2017-05-15 23:13:11


Gavin Lambert wrote:

> I don't know if it would be worthwhile to try to optimise storage for that
> case. [result<optional<T>>]

An interesting point, because this is an argument in favor of returning by
value from result<>::value() - I can synthesize an optional<T> on demand
instead of storing one. (Return by reference mandates having an optional<>
object stored.)

Also applies to other possible combinations such as expected<expected<T,
E1>, E2>, outcome<expected<T, E>>, and so on that can all in principle be
flattened into a single variant under the hood.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk