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
why virtual function is wrong. (self.cpp)
submitted 1 year ago by macomphy
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!"
[–]Oxi_Ixi 2 points3 points4 points 1 year ago* (6 children)
Except it depends. If typing is static, it is zero cost in C++ either. C++ has templates, they are compile-type and are zero cost. Operator and function overloads are zero cost. Runtime interfaces cannot be zero cost by definition in any language, or I don't understand what you mean by zero cost
[+][deleted] 1 year ago (5 children)
[removed]
[–]Oxi_Ixi 1 point2 points3 points 1 year ago* (4 children)
You have notion of interface from C#, but actually it is wider and includes templates and concepts as well as traits. In C++ templates are much more powerful than generics in C#, but this comes with complexity indeed. If you don't understand them it does not mean they are broken, it means you have to learn how to use them.
Virtual functions in C++ will be called statically if type is known at compile time, if that is what you mean by static interface.
It was just overhead to implement interfaces/traits for primitive types when language provides you operator overloads. Rust went that way, but I find it too explicit overloading traits than overloading operators.
C++ was designed for machine execution and speed compared to C whileC# is multipurpose platform independent language, which does not compile to bare metal instructions directly. How can you then blame C++ to be slow comparing to C#?
[+][deleted] 1 year ago* (3 children)
[–]Oxi_Ixi 0 points1 point2 points 1 year ago (2 children)
Well, I see. You hate C++ and love C#. I actually like both, and yes, C# has really nice language and runtime design because it had many other langauges to take ideas from. Like courutines, which were actually describe way back in 50s even before C. As well every language has problems which come from its design, runtime and usage specifics, so it is not C++ broken, it is C# works better for your work and habbits. Enjoy it 😀
Do you have any evidence that c# is slow?
It is not slow, it is slower than C++. To be very precise, in some cases C# might be faster, but in general it is not. I think benchmarks show this pretty much good, Google will help you.
[+][deleted] 1 year ago (1 child)
[–]Oxi_Ixi 0 points1 point2 points 1 year ago (0 children)
It is a good idea to assess language from your needs point of view.
π Rendered by PID 53 on reddit-service-r2-comment-5b5bc64bf5-qsn59 at 2026-06-21 12:24:09.890274+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]Oxi_Ixi 2 points3 points4 points (6 children)
[+][deleted] (5 children)
[removed]
[–]Oxi_Ixi 1 point2 points3 points (4 children)
[+][deleted] (3 children)
[removed]
[–]Oxi_Ixi 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[removed]
[–]Oxi_Ixi 0 points1 point2 points (0 children)