AMDG 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. In Christ, Steven Watanabe