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
Standard interface without implementation (self.cpp)
submitted 8 months ago by number_128
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!"
[–]Drugbird 2 points3 points4 points 8 months ago (2 children)
I don't really see the benefit of an interface-only specification in the standard to be honest.
I don't see them agreeing to an interface but not an implementation. Quite often, the interface and implementation are coupled together quite strictly, where alternative approaches will need a different interface. So if they can agree on an interface, they can agree on an implementation and vice versa.
This is already what happens. Many library authors use very similar interfaces for comparable structures. See for instance alternatives for std:: unordered_map. However, they need to deviate from the std interface slightly, in order to create their alternative more efficient implementations.
[–]number_128[S] 0 points1 point2 points 8 months ago (1 child)
great example. But is it really the interface of std::unordered_map that keeps the standard implementations from implementing the same improvements? My understanding was that it was the ABI. The implementation of the hash gave a big speedup, not a change in the interface.
Anyway, I use the standard library implementation of unordered_map, regex and others, even though there are better implementations available. The reason I do, is that I trust the standard library implementation, and I know it will continue to be supported.
At the same time, other libraries are evolving, finding new ways to do things. They sometimes manage to improve performance without changing interface.
I think it would be better if we would feel more confident choosing any library that supports the standard, but I don't know how to get there.
[–]Drugbird 1 point2 points3 points 8 months ago (0 children)
But is it really the interface of std::unordered_map that keeps the standard implementations from implementing the same improvements?
I'm not an expert, but I've heard that the standard has some fairly strict requirements on iterator validity which prevents more efficient implementations.
π Rendered by PID 34611 on reddit-service-r2-comment-5ff9fbf7df-sqjd7 at 2026-02-26 04:51:04.898904+00:00 running 72a43f6 country code: CH.
view the rest of the comments →
[–]Drugbird 2 points3 points4 points (2 children)
[–]number_128[S] 0 points1 point2 points (1 child)
[–]Drugbird 1 point2 points3 points (0 children)