How do I construct thee? Let me count the ways...
by Barry Revzin
From the article:
Several years ago, I wrote a post about the complexities of implementing comparison operators for
optional<T>: Getting in trouble with mixed comparisons. That post was all about how, even just for
==, making a few seemingly straightforward decisions leads to an ambiguity that different libraries handle differently.
Now is a good time to circle back to that same idea, except this time instead of talking about equality comparison, we’re just going to talk about construction. This post is going to work through a bunch of cases of trying to construct an object of type
Xfrom an object of type