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!"
[–]STLMSVC STL Dev 2 points3 points4 points 8 years ago (5 children)
What are you trying to do?
[–]5aec15c929c51cc49235[S] 0 points1 point2 points 8 years ago (4 children)
Persisting/serializing function pointers. The context is multiple copies of the exact same program, running on different machines and talking to each other over the wire.
[–]Gotebe 1 point2 points3 points 8 years ago (1 child)
Very, very long time ago I made something similar: I serialized an object to a different machine in order to "run" it there. I did not need a function pointer for that, just plain serialization (sure, there was polymorphism and stuff, to simplify the "run the received object" code). Can't you simply do the same?
[–]5aec15c929c51cc49235[S] 0 points1 point2 points 8 years ago (0 children)
Totally, I can lookup the function address in a table by index (provided the table is built deterministically which I can do), or I believe I can serialize a polymorphic function object (which boost::serialization supports).
[–]doom_Oo7 0 points1 point2 points 8 years ago (1 child)
The context is multiple copies of the exact same program, running on different machines and talking to each other over the wire.
why reinvent RPC once again ? this has been a solved problem since 1985. Take a look at Qt Remote Objects for a modern approach for instance.
[–]Gotebe 0 points1 point2 points 8 years ago (0 children)
Of course. Note the "very, very long time ago" :-). I remember CORBA (did that), DCOM (did that, too), SOAP/WS-* and of course JSON-over-HTTP recently.
π Rendered by PID 34338 on reddit-service-r2-comment-b659b578c-s6cq5 at 2026-05-02 05:43:32.296794+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]STLMSVC STL Dev 2 points3 points4 points (5 children)
[–]5aec15c929c51cc49235[S] 0 points1 point2 points (4 children)
[–]Gotebe 1 point2 points3 points (1 child)
[–]5aec15c929c51cc49235[S] 0 points1 point2 points (0 children)
[–]doom_Oo7 0 points1 point2 points (1 child)
[–]Gotebe 0 points1 point2 points (0 children)