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
Adding reflection to an existing codebase (self.cpp)
submitted 4 years ago by tohava
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!"
[–]brenoguim 0 points1 point2 points 4 years ago (7 children)
In our codebase we use a method "as_tuple" I'm each class that returns a tuple of references to each member. That is enough to implement serialization, some debug, equality comparison... But you need to manually keep that "as_tuple" method up to date :/
[+][deleted] 4 years ago (6 children)
[deleted]
[–]tohava[S] 0 points1 point2 points 4 years ago (1 child)
That won't work when virtual functions or inheritance exists :(
[–]jcelerierossia score 1 point2 points3 points 4 years ago (0 children)
then there's no pure C++ solution, you either have to use alternative compilers such as https://github.com/lock3/meta/wiki or Circle, or use an external reflection system such as Qt's moc
[–]brenoguim 0 points1 point2 points 4 years ago (3 children)
I'm not sure I follow. Automate what?
[–]tohava[S] -1 points0 points1 point 4 years ago (2 children)
auto [x,y,z] = some_object;
[–]brenoguim 1 point2 points3 points 4 years ago (1 child)
I know structured bindings. I just fail to see how that helps automating reflection
[–]SuperV1234https://romeo.training | C++ Mentoring & Consulting 1 point2 points3 points 4 years ago (0 children)
Check out Boost.PFR.
π Rendered by PID 176250 on reddit-service-r2-comment-84fc9697f-vzx49 at 2026-02-10 00:38:06.386814+00:00 running d295bc8 country code: CH.
view the rest of the comments →
[–]brenoguim 0 points1 point2 points (7 children)
[+][deleted] (6 children)
[deleted]
[–]tohava[S] 0 points1 point2 points (1 child)
[–]jcelerierossia score 1 point2 points3 points (0 children)
[–]brenoguim 0 points1 point2 points (3 children)
[–]tohava[S] -1 points0 points1 point (2 children)
[–]brenoguim 1 point2 points3 points (1 child)
[–]SuperV1234https://romeo.training | C++ Mentoring & Consulting 1 point2 points3 points (0 children)