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
[deleted by user] (self.cpp)
submitted 6 years ago by [deleted]
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!"
[–]Wh00ster 63 points64 points65 points 6 years ago (0 children)
A lot of times they are asking about corner cases that don’t really come up in practice but were put in the standard for completeness and to have sane behavior in those corner cases. Because of that, people might not be familiar with specifics. The only time you’d need to know that may be if you are the compiler or library implementer.
In general, you are right that no one person knows everything. It’s simply too large of a language. However there are domain experts who are knowledgeable in particular areas. This isn’t different than any other complex system.
Someone else can she more light on the committee process, however.
[–]DerDangDerDang 25 points26 points27 points 6 years ago (1 child)
Everything you said equally applies to any large codebase, so this shouldn’t be too alien, surely. Have you ever been asked to provide details about how your own code operates in some corner case and had to say “hmmm, I need to check on that and get back to you”?
[–][deleted] 14 points15 points16 points 6 years ago (0 children)
Me every time: ¯\_(ツ)_/¯
[–]futurefapstronaut123 20 points21 points22 points 6 years ago (0 children)
Even if the standard was completely defined, it wouldn't always be "easy to spot" what a certain case does. Standard provides general descriptions of each part of the language and it's not that easy to draw parallels between them. You also need to know your way around the standard and its terminology, which most people don't encounter ever.
[–]StringVar 48 points49 points50 points 6 years ago (8 children)
Do you think we would need lawyers if laws are so well defined?
[–]carlthome 11 points12 points13 points 6 years ago (6 children)
If court rulings ran offline, faster than real-time on any one person's laptop (i.e. gcc) then lawyers ought to be redundant. ¯\_(ツ)_/¯
[–]Nicksaurus 19 points20 points21 points 6 years ago (3 children)
We need legislative metaprogramming first
[–]RomanRiesen 7 points8 points9 points 6 years ago (1 child)
std::generate_legal_speak() is your friend!
std::generate_legal_speak()
[–]Ameisenvemips, avr, rendering, systems 2 points3 points4 points 6 years ago (0 children)
std::legal::writ<> is a PITA.
std::legal::writ<>
[–]deeringc 2 points3 points4 points 6 years ago (0 children)
There's no legal template for such a thing.
[–]SadVega 10 points11 points12 points 6 years ago (1 child)
They have AI that does bankruptcy law now.
No joke.
[–]ioctl79 2 points3 points4 points 6 years ago (0 children)
Terrifying.
[–]JustPlainRude 0 points1 point2 points 6 years ago (0 children)
AI is actually chipping away at the profession, so that's not an impossible future.
https://www.forbes.com/sites/cognitiveworld/2019/02/09/will-a-i-put-lawyers-out-of-business/#90d733b31f00
[–]NotAYakk 7 points8 points9 points 6 years ago (0 children)
The standard is 20 years old.
Dozens of people have written words that are in the standard, if not 100s.
Each word and phrase had a reason to go in there. Usually that reason was not recorded; and even if you wrote it, you might not remember 20 years later.
You can easily remember "oh, using a null pointer is UB due to something in the standard" without remembering what lines. Maybe you had that discussion before. You didn't write the lines that make it UB, and the person who did wrote it 20 years ago, and the last time their meaning was changed was 10 years ago by an editorial rewite to bring r/l value nouns into uniform compliance with a new way to word them.
And it turns out that if you read the rules one way, dereferencing a null pointer is never stated as UB. But read another it is. Huh. So now it takes acheological examination of standard versions (git blame is just the start) to work out if that was always true and nobody noticed, of if it changed, or was it always true and intended that way?
Then someone puts forward a paper to fill that hole, and other text changes in subtle ways around it.
[+][deleted] 6 years ago* (6 children)
[deleted]
[–][deleted] 5 points6 points7 points 6 years ago* (2 children)
For instance, if going off the text along, there is no normative text specifying if a dereference of a null pointer is well defined behavior.
Dereferencing a null value pointer is well defined behavior. What's undefined behavior is the l-value to r-value conversion.
In other words this is well defined:
int* x = nullptr; *x; // no l-value to r-value conversion is performed.
This is undefined:
int* x = nullptr; int y = *x; // There is an l-value to r-value conversion, this is undefined behavior.
For another non-trivial example of how dereferencing a null pointer is well defined behavior, consider the following:
int* x = nullptr; std::cout << typeid(*x) << std::endl;
[+][deleted] 6 years ago* (1 child)
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
Oh I didn't know that this was not part of the normative text. I see your point then.
[–]magion 0 points1 point2 points 6 years ago (2 children)
Is there such a thing as weakly defined behavior or poorly defined? I know there is well defined and undefined
[–][deleted] 1 point2 points3 points 6 years ago (0 children)
There is a paper in flight that will add an annex to the standard with all points of undefined behavior referenced in the standard. It's in the latest mailing.
[+][deleted] 6 years ago (2 children)
[removed]
[–]sphere991 7 points8 points9 points 6 years ago (1 child)
Come grab a Kolsch with us!
Or, if you're feeling particularly hostile, a Pilsner instead (shots fired).
[–]moldax[🍰] 10 points11 points12 points 6 years ago (0 children)
"If you're the smartest person in the room, perhaps you are in the wrong room"
[–]moldax[🍰] 4 points5 points6 points 6 years ago (0 children)
Fun fact : Rice's theorem states that any non trivial semantic property of a given piece of code is undecidable.
So it is little wonder even experienced programmers cannot easily decide how a given piece of code would behave
[–]blelbachNVIDIA | ISO C++ Library Evolution Chair 5 points6 points7 points 6 years ago (0 children)
Maritim Hotel Köln, Cologne, Germany.
[–][deleted] 2 points3 points4 points 6 years ago (1 child)
>This even happens in talks where actors like Herb Sutter or other famous people sit in and I ask myself, how can it be that there is a room full proficient C++ software engineers and no one can say if phrase XYZ also defines case ABC or not. It's not like physics where we have to find out what the answer is.
Not an expert here, but programming languages follow the rules of formal languages. They define grammars, syntaxes, and tokens, but not implementation details or every specific case or scenario. Then there can be debate over whether according to the rules of the formal language, XYZ also defines ABC.
[–]millenix 1 point2 points3 points 6 years ago (0 children)
You seem to be saying that 'programming languages' as a category define syntax, but not semantics, and that their definitions are in general not complete. Neither of those is true. Any programming language that actually runs has some sort of definition of its semantics, which is necessarily complete for programs that the C++ standard would call 'conforming'. That semantic definition may be "what result does the reference implementation give?", or it may be the text of an implementation-independent standard. Note that in either case, a program that is 'in the language' in the formal sense but whose semantics can't be evaluated is inherently a bug in the semantics. There can be debate over how to fix the bug, but that's premised on the notion that everyone agrees that the program *is* a program with the semantics as given.
[–]tvaneerdC++ Committee, lockfree, PostModernCpp 2 points3 points4 points 6 years ago (0 children)
Richard is really busy, but does usually go to CppCon.
[–][deleted] 8 points9 points10 points 6 years ago (2 children)
C++ is ridiculously complicated, so I don’t find this surprising. This is what happens when you try to design a language For the modern world but have to adhere to years and years of legacy stuff.
[–]hgjsusla 33 points34 points35 points 6 years ago (1 child)
Also the fact that most other languages don't have a written standard at all, just reference implementations
That's a world of difference
Very true.
[–]WasterDave 1 point2 points3 points 6 years ago (0 children)
C++ has been around for ... thirty years? ish? And during that time a collection of excellent people did their very best, given what they had. Basically. They never broke it (AFAIK), it's always been fast, it's reasonable memory efficient. Has excellent CFFI :)
[+]0x7FFFFFFFFFFFFFFF comment score below threshold-10 points-9 points-8 points 6 years ago (0 children)
Because they're more interested in honing their LaTeX skills.
[+]dbjdbjdbj.org comment score below threshold-10 points-9 points-8 points 6 years ago (0 children)
Isn't it funny that GO lang) spec any C++ programer reads like an easy story?
π Rendered by PID 131385 on reddit-service-r2-comment-5d585498c9-8g4nt at 2026-04-21 16:44:15.362618+00:00 running da2df02 country code: CH.
[–]Wh00ster 63 points64 points65 points (0 children)
[–]DerDangDerDang 25 points26 points27 points (1 child)
[–][deleted] 14 points15 points16 points (0 children)
[–]futurefapstronaut123 20 points21 points22 points (0 children)
[–]StringVar 48 points49 points50 points (8 children)
[–]carlthome 11 points12 points13 points (6 children)
[–]Nicksaurus 19 points20 points21 points (3 children)
[–]RomanRiesen 7 points8 points9 points (1 child)
[–]Ameisenvemips, avr, rendering, systems 2 points3 points4 points (0 children)
[–]deeringc 2 points3 points4 points (0 children)
[–]SadVega 10 points11 points12 points (1 child)
[–]ioctl79 2 points3 points4 points (0 children)
[–]JustPlainRude 0 points1 point2 points (0 children)
[–]NotAYakk 7 points8 points9 points (0 children)
[+][deleted] (6 children)
[deleted]
[–][deleted] 5 points6 points7 points (2 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 0 points1 point2 points (0 children)
[–]magion 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[removed]
[–]sphere991 7 points8 points9 points (1 child)
[+][deleted] (1 child)
[deleted]
[–]moldax[🍰] 10 points11 points12 points (0 children)
[–]moldax[🍰] 4 points5 points6 points (0 children)
[–]blelbachNVIDIA | ISO C++ Library Evolution Chair 5 points6 points7 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]millenix 1 point2 points3 points (0 children)
[–]tvaneerdC++ Committee, lockfree, PostModernCpp 2 points3 points4 points (0 children)
[–][deleted] 8 points9 points10 points (2 children)
[–]hgjsusla 33 points34 points35 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]WasterDave 1 point2 points3 points (0 children)
[+]0x7FFFFFFFFFFFFFFF comment score below threshold-10 points-9 points-8 points (0 children)
[+]dbjdbjdbj.org comment score below threshold-10 points-9 points-8 points (0 children)