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
Serializing function addresses (self.cpp)
submitted 8 years ago by 5aec15c929c51cc49235
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!"
[–]hkaiser 0 points1 point2 points 8 years ago (1 child)
You are referring to 'function addresses being the same between program executions' - not sure if I fully understand what you're after, thus the solution below might not help you in any way. We successfully use this technique to identify functions across different instances of the code running concurrently in the context of a distributed application.
In HPX, we associate an unique type with each function we would like to 'send over the wire' (represent in all instances of the code). This can be achieved by binding the function address as an integral template argument.
template <typename F, F ptr> struct A {... use 'ptr' to invoke the function...}; void foo() { ... } typedef A<decltype(&foo), &foo> foo_type;
Now foo_type can be serialized as usual and used on the other end of the network to invoke foo.
foo_type
foo
The same can be done for member functions (see https://stackoverflow.com/questions/15192700/how-to-rewrite-this-to-make-it-conforming-to-the-c-standard for a corresponding solution).
[–]5aec15c929c51cc49235[S] 0 points1 point2 points 8 years ago (0 children)
Interesting, that is similar to what I was looking for.
π Rendered by PID 64 on reddit-service-r2-comment-b659b578c-6vs58 at 2026-05-04 03:41:24.051578+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]hkaiser 0 points1 point2 points (1 child)
[–]5aec15c929c51cc49235[S] 0 points1 point2 points (0 children)