Argument dependent lookup (ADL): name taxonomy, customization points & use cases
summary
Explains exactly when ADL adds associated namespaces/entities (class, enum, underlying types, template arguments, pointer-to-member rules) and shows how unqualified dependent names trigger ADL at instantiation; demonstrates real pitfalls (unqualified std::algorithms and a nonportable std::tie overload case) and builds a working customization point object for swap using SFINAE and a poison pill fallback + is_adl_swappable trait; the resulting swap object is first‑class, does ADL correctly, and lets algorithms accept user overloads safely.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:37Why ADL
- 9:16Unqualified lookup
- 14:04Function type lookup
- 18:21Template types
- 19:45Dependent names
- 20:36Argument dependent lookup
- 23:26Friends and ADL
- 27:29Unconstrained templates
- 30:03Iterators
- 32:31Guidelines
- 33:55Customization points
- 38:44Customization point objects
- 45:35Questions
related talks
01h 05mDon’t Get Overloaded by C++ Overload Sets
01h 16mNamespaces 101
04mADT puzzler
01h 37mRethinking the Way We Do Templates in C++ even more
34mAllocator-Aware C++ Type Design
01h 00mClass template argument deduction in C++17
01h 13mThe 10 Essential Features for the Future of C++ Libraries
01h 31mAllocator-Aware (AA) Software
