Boost logo

Boost :

Subject: Re: [boost] compact_optional -- prompting interest
From: Gonzalo BG (gonzalobg88_at_[hidden])
Date: 2015-09-29 21:10:03


I still would prefer to have a static function to explicitly construct a
compact_optional from a value that _may_ be a sentinel value to indicate
that the resulting optional (constructed from a value) may indeed be empty.
It just seemed more in line with optional to do it this way than the other
way around, even though both are equivalent in functionality.

Having said this, I have only tried one of the both possible approaches
here in practice, and my use case is a small portion of the use cases that
compact_optional can cover. For instance string::npos is a nice use case of
compact optional and I would like it to work as seamlessly as possible.


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