page = arthur o'dwyer – stuff mostly about c++
url = https://quuxplusone.github.io/blog
argument-dependent-lookup customization-points library-design name-lookup pitfalls slack standard-library-trivia
As seen on the cpplang Slack (hat tip to Jody Hagins). Recall my post “What is the std::swap two-step?” (2020-07-11), where I said:
A qualified call like
base::frotz(t)
indicates, “I’m sure I know how to
frotz
whatever this thing may be. No type
T
will ever know better than me how to
.”
An unqualified call using the two-step, like
using my::xyzzy; xyzzy(t)
, indicates, “I know one way to
xyzzy
whatever this thing may be, but
itself might know a better way. If
has an opinion, you should trust
over me.”
An unqualified call not using the two-step, like
plugh(t)
, indicates, “Not only should you trust
over me, but I myself have no idea how to
plugh
anything. Type
must come up with a solution; I offer no guidance here.”