|
Boost : |
Subject: Re: [boost] [optional] Safe optional
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2014-11-18 02:42:33
On Mon, Nov 17, 2014 at 11:16 PM, Matt Calabrese <rivorus_at_[hidden]> wrote:
> On the other hand, safe_optional and optional would basically be two
> templates that have identical implementation with just different
> interfaces. If you can say objective things about one being safer, and all
> else is equal, then it should be THE library and the old optional should be
> deprecated. I don't think it's worth having two libraries when they are so
> similar.
>
Also, to be clear, I'm not saying I believe that safe_optional is
necessarily the right way to go, I just think that if it were to be decided
that it is worthwhile, it should probably just replace optional. I'm not
entirely convinced that it's really worth a new template, though.
Ultimately I think it's probably best to simply create/evangelize
high-order visitation accessors and have them work with the existing
optional. Then just be clear in documentation that their use is recommended
over raw access. It's the same with variant and I don't think that's a
problem -- encourage visitation, but allow direct access.
-- -Matt Calabrese
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk