On Mon, Sep 28, 2015 at 4:02 PM, Sam Kellett
this applies to any possible value of int -- so therefore somebody, somewhere will have a valid int that is an optional and some purely genetic code will get it wrong
er.. generic.. doh
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
This is more in line with the compact_optional proposal in the other thread. The specialization is only created for a value that cannot otherwise exist for your type. Any magic value of int is a valid int value, so there would not be a specialization of optional<int> that makes, say, -1 invalid. In this proposal, there is absolutely nothing the user can do other than sizeof that lets them tell the difference (and they won't run out of memory as quickly from allocating a bunch of them).