C++ Logo

std-discussion

Advanced search

Re: Member function, using, and ADL

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Sat, 29 May 2021 20:03:11 +0300
On Sat, 29 May 2021 at 19:16, Edward Catmur via Std-Discussion
<std-discussion_at_[hidden]> wrote:

> That is, the point of "using std::swap;" is twofold; it both hides any class member "swap", and makes "std::swap" available as a fallback if ADL does not find a suitable candidate. But ADL-located candidate names are preferred.

No they're not, the call is overload-resolved. The ADL-located
candidates win if they're better matches, but
there's no preference for them otherwise. See
https://wandbox.org/permlink/CuYwIMxcXv3RZA4k

Received on 2021-05-29 12:03:24