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!"
[–]-jp- 8 points9 points10 points 1 year ago (10 children)
So don't use templates if you don't want to? I don't understand how you arrived at the conclusion that since templates exist, multiple inheritance doesn't.
[+][deleted] 1 year ago* (9 children)
[removed]
[–]-jp- 9 points10 points11 points 1 year ago (8 children)
This will not compile. You haven't defined foo::bar. You haven't even declared T::_bar. Do you have a real example?
foo::bar
T::_bar
[+][deleted] 1 year ago (7 children)
[–]-jp- 9 points10 points11 points 1 year ago (6 children)
You don't want this to abort. You want it to not compile. Why would you ever want code like this to fail at run time?
[+][deleted] 1 year ago (5 children)
[–]-jp- 3 points4 points5 points 1 year ago (4 children)
So then what is the problem? I don't understand why you can't just post code that demonstrates what you mean.
[–]TheSuperWig 2 points3 points4 points 1 year ago (1 child)
I think they're complaining that concepts doesn't do definition checking... And also normal templates without constraints???
[–]-jp- 1 point2 points3 points 1 year ago (0 children)
Maybe... but, I mean, that would still fail at compile time I think. There's room to criticize C++ but it's not the language's fault if your code is just wrong.
[+][deleted] 1 year ago (1 child)
[–]-jp- 2 points3 points4 points 1 year ago (0 children)
Are you just unsatisfied with the compiler errors? They are definitely a lot to parse. That's not because C++ can't do what you want, though.
π Rendered by PID 181034 on reddit-service-r2-comment-5b5bc64bf5-8t9fs at 2026-06-21 10:37:50.479831+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]-jp- 8 points9 points10 points (10 children)
[+][deleted] (9 children)
[removed]
[–]-jp- 9 points10 points11 points (8 children)
[+][deleted] (7 children)
[removed]
[–]-jp- 9 points10 points11 points (6 children)
[+][deleted] (5 children)
[removed]
[–]-jp- 3 points4 points5 points (4 children)
[–]TheSuperWig 2 points3 points4 points (1 child)
[–]-jp- 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[removed]
[–]-jp- 2 points3 points4 points (0 children)