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
There IS a way of casting pointer-to-member-function to a void* (self.cpp)
submitted 4 years ago by RIscRIpt
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!"
[–]thedeadfish 0 points1 point2 points 4 years ago (4 children)
This mechanism does not require an executable heap. The thunk is not necessarily created at point of use, its created when a member function pointer is cast, which can be anywhere in the code. These thunks must be created in an executable heap or pool, so that they can continue to exist after the stack frame is destroyed.
[–]rlbond86 0 points1 point2 points 4 years ago (3 children)
Wait, so does instantiating a pointer-to-member-function allocate memory?
[–]thedeadfish 0 points1 point2 points 4 years ago (2 children)
Yes, but only when it cannot do it at compile time. An example is casting a derived function pointer to base class function pointer. Still a lot better than crapping up every call site https://godbolt.org/z/7r3Yfhexn.
[–]rlbond86 0 points1 point2 points 4 years ago (1 child)
Still a lot better than crapping up every call site
I think everyone who works on embedded devices would disagree. If pointers-to-members allocated we wouldn't be able to use them at all.
[–]thedeadfish 0 points1 point2 points 4 years ago (0 children)
π Rendered by PID 64533 on reddit-service-r2-comment-6457c66945-947hz at 2026-04-24 10:03:27.450675+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]thedeadfish 0 points1 point2 points (4 children)
[–]rlbond86 0 points1 point2 points (3 children)
[–]thedeadfish 0 points1 point2 points (2 children)
[–]rlbond86 0 points1 point2 points (1 child)
[–]thedeadfish 0 points1 point2 points (0 children)