9 Dec
2014
9 Dec
'14
6:31 p.m.
Matt Calabrese wrote:
While that's true, the old behavior seems about as compelling to me as if the language allowed you to static_cast between any two types, but yielded a null pointer at run-time if there were no valid conversion.
That's not true. Both get variants can fail (at runtime) if the variant
doesn't contain the target, so your code that uses either MUST be prepared
to deal with this case. The difference is only that one of them allows you
to ask "does this variant