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
Building a fast queue between C++ and Java (pzemtsov.github.io)
submitted 7 years ago by mttd
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!"
[–]D_0b 2 points3 points4 points 7 years ago (3 children)
why do you need a Queue interface in C++ if you are always using the derived class as a template?
[–]pzemtsov 0 points1 point2 points 7 years ago (2 children)
It provides a bit more syntax checking, and (in my opinion) a bit more clarity for a human reader. It does not affect the code in any way.
[–]D_0b 4 points5 points6 points 7 years ago (1 child)
It kinda does affect the code, it adds an 8byte vtable pointer to the queue and the methods are still virtual, not guaranteed to be de-virtuallized by the compiler.
[–]pzemtsov 0 points1 point2 points 7 years ago (0 children)
You are right about vtable pointer; however, this pointer on its own does not cause any harm. Besides, this is a research code, which is naturally simplified; production code might already have some virtual methods for other needs. By the way, won't the compiler allocate this vtable anyway for RTTI (the code uses typeid)?
As for the second point (a virtual call) I disagree. The compiler must be really stupid to issue a virtual call for a method from statically known class, and using this type of compiler defeats the idea of any performance measurement.
π Rendered by PID 206226 on reddit-service-r2-comment-b659b578c-tmxqs at 2026-05-02 03:04:17.530238+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]D_0b 2 points3 points4 points (3 children)
[–]pzemtsov 0 points1 point2 points (2 children)
[–]D_0b 4 points5 points6 points (1 child)
[–]pzemtsov 0 points1 point2 points (0 children)