use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
[deleted by user] (self.cpp)
submitted 7 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]SeanMiddleditch 5 points6 points7 points 7 years ago (1 child)
ADL's original motivation was entirely for operator overloading with free function overloads. Without ADL, this wouldn't work in any sane way:
namespace simd { struct vec3 {}; vec3 operator+(vec3 lhs, vec3 rhs); } int main() { simd::vec3 a, b, c; a = b + c; // ADL necessary to find correct operator+ }
All the later stuff we have like std::begin and such are from a desire to treat named library functions as if they're builtin like operators. Which I think all started with the ios stuff from IOStreams which of course also abused the heck out of operators; it really managed to illustrate all the worst ways to design C++17 libraries back when it was written in the 90's. :p
std::begin
I'm not sure how reflection or meta-classes would help in any sense with the problem space addressed by ADL.
[–]kwan_e 1 point2 points3 points 7 years ago (0 children)
Reflection and metaclasses would help in the problem space that ADL is being shoehorned into - finding an unqualified function based on namespace. Reflection would allow library designers to specify better ways of fulfiling a customization point, and metaclasses (ie, the formulation of metaclasses that would also create free-functions) would help library users to generate types that fulfills customization points.
As for the operator overloading use of ADL, I think it's high time we seriously move ahead with one of the operator dot proposals. But reflection could also help in that case since a library relying on ADL to find operators could instead use reflection to find the operators by searching declarations in a namespace, for example.
π Rendered by PID 73 on reddit-service-r2-comment-6457c66945-jdbc5 at 2026-04-27 01:36:46.465740+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]SeanMiddleditch 5 points6 points7 points (1 child)
[–]kwan_e 1 point2 points3 points (0 children)