C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Member function, using, and ADL
From: Ville Voutilainen (ville.voutilainen_at_[hidden])
Date: 2021-05-29 12:03:11


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


STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups