Subject: Re: [boost] [outcome] On the design and documentation
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2017-05-28 17:40:11
On 05/26/2017 07:43 AM, Niall Douglas via Boost wrote:
>>> Why do you prefer get? what do you get with get? How will you name the
>>> function that give you access to the value of a PossiblyValued type?
>> It's really just a different color. The preference to get is coming from
>> my mental model of mine with expected being more like a asynchronous
>> return object (future calls it get as well). There are other types (with
>> similar purpose) using the name get for their accessor: shared_ptr,
>> unique_ptr, tuple and variant.
> Everyone else hated this idea, but what do you think of:
> - T& .value() returns a reference to the value, non-destructive.
> - T .get() returns the value by value, destructive.
I hate it too. Who (besides you, the author) will
be able to remember which one is which.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk