30 Sep
2015
30 Sep
'15
1:10 a.m.
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.