On 20/08/2014 9:54 AM, Gavin Lambert wrote:
If you made your type implicitly convertible to optional and back, that ought to make everybody happy. :) (Well, except maybe the folks who hate implicit conversions, but they're never happy.)
I love implicit conversions. I love implicitly converting const char* to std::string. I love implicitly converting std::string to boost::optionalstd::string. So imagine my heartache when they told me I couldn't implicitly convert const char* to boost::optional<string>. What, you mean I can't really use const char * /wherever/ I can use std::string? Well, no, you can't, and I think that's good since multi-level implicit conversion could get very confusing and quite ambiguous: If there were several conversion paths, which one should the compiler choose? Adding an additional include file could then change the choice...
I feel that I'm in for more tears if we have an implicit conversion from boost::optional to something else. Nah, at least not in the cases I have in mind. Another overload or
On 2014-08-20 08:30, Michael Shepanski wrote: partial specialization will do just fine. Cheers, Roland