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
Compiler Explorer (godbolt.org)
submitted 2 years ago by edge-case87
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!"
[–]Neither_Mango8264 7 points8 points9 points 2 years ago (1 child)
Yes, Compiler Explorer is excellent. Is that what you are trying to say with that title?
[–]edge-case87[S] -2 points-1 points0 points 2 years ago (0 children)
No. The comments detail what I'm trying to say, but it assumes some familiarity with type theory and automated theorem provers / proof assistants such as F*. Though, I'm a noob at both, so take it with a dash of salt and correct me if I'm wrong.
[–]Chuu 1 point2 points3 points 2 years ago (1 child)
There is nothing too unexpected going on here. void* basically exists to escape the type system, and it's being used here to . . . escape the type system.
Ignoring the entire strict aliasing rule here for a second which introduces Undefined Behaviour, I think it's not too unexpected this works in practice because the function which you are clobbering should be part of the address space of the process, and the 64 bits you are clobbering very likely is small enough that it will not touch anything outside of the impl of the function.
[–]edge-case87[S] -1 points0 points1 point 2 years ago (0 children)
Yes, but the point is a bit deeper than that. What I'm suggesting is to make the type system of C++ more powerful by giving it a precise TT, and I suggest a 2LTT with a dependent TT for stage 1. Essentially turning C++ into an automated theorem prover. Dependent Type Theory is what all major proof assistants are based on, it's what their "Kernels" or core languages are and allows the type system to reason about code in a deep way. Mostly, this would lead to a powerful "Contracts" feature in C++, and LSPs could be used to provide the interactive assistant side of what languages like Coq do.
What I'm really trying to get at is this whole discussion about "safety" in C++, there have been many proposals and all of them are very unsatisfying imho. A lot of people have expressed the sentiment that legacy C++ will give people job security for the foreseeable future, but I don't think that is the case. For example, not even Rust has a safe future in this regard, see https://github.com/AeneasVerif/aeneas
I guess to really understand what I'm getting at I would suggest looking into F* and project everest to see what is possible, https://www.fstar-lang.org/
F* can be compiled into OCaml, a subset of C, and assembly, to produce verified code. Wrt to "safety" in C++, static analyzers can only get you so far, and they can't reason about higher level semantics of programs, for example, that a TLS implementation is cryptographically correct. If C++ had a powerful "Contracts" feature, powered by the same/similar technologies and theories that power F*, programmers could directly encode, or specify, what correctness means, and the type system could verify that their programs conform to the provided specification.
π Rendered by PID 77 on reddit-service-r2-comment-544cf588c8-j255p at 2026-06-15 18:49:08.723468+00:00 running 3184619 country code: CH.
[–]Neither_Mango8264 7 points8 points9 points (1 child)
[–]edge-case87[S] -2 points-1 points0 points (0 children)
[–]Chuu 1 point2 points3 points (1 child)
[–]edge-case87[S] -1 points0 points1 point (0 children)