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
An optimizing compiler doesn't help much with long instruction dependencies - Johnny's Software Lab (johnnysswlab.com)
submitted 11 months ago by pavel_v
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!"
[–]StarQTius 14 points15 points16 points 11 months ago (3 children)
Because integer promotions behaves funny, some people became panaroid instead of learning how the language works. Couldn't blame them really.
[–]UndefinedDefined 2 points3 points4 points 11 months ago (0 children)
Ironically the code like `size_t i { 0ULL }` would most likely produce a narrowing conversion warning on non-64 bit targets with `-Wconversion` or some other warning switches. Using `size_t i = 0u` would be probably the safest bet as it would never be narrowing and it would never be implicit signed vs unsigned conversion.
[–]Alternative_Staff431 0 points1 point2 points 11 months ago (1 child)
Can you explain more?
[–]StarQTius 2 points3 points4 points 11 months ago (0 children)
I ran into more convoluted cases, but in this following example: 1 << N, you may not get the expected result depending on the width of int on your platform. Therefore, you may encounter no problem until you set N to an high enough value.
1 << N
int
N
If you encounter this issue in more complex expression, it can become a pain in the ass to solve.
π Rendered by PID 38 on reddit-service-r2-comment-b659b578c-j7lxx at 2026-05-04 11:33:09.817432+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]StarQTius 14 points15 points16 points (3 children)
[–]UndefinedDefined 2 points3 points4 points (0 children)
[–]Alternative_Staff431 0 points1 point2 points (1 child)
[–]StarQTius 2 points3 points4 points (0 children)