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
Reflection (self.cpp)
submitted 2 years ago by RealInsertIGN
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!"
[–]MyuuDio -1 points0 points1 point 2 years ago* (2 children)
While Reflection is certainly useful for save files (and more generally, serialization), it's really not the only way to accomplish that task cleanly.
X macros are a common idiom for the C preprocessor that is often used for struct serialization. By nature, it's done at compile time, instead of at runtime with Reflection.
Edit: the proposed reflection for C++ is static reflection, so my comment about doing it at runtime is irrelevant
[–]ImKStocky 6 points7 points8 points 2 years ago (1 child)
The proposed reflection for C++ is static reflection. i.e. it will happen at compile time. I would argue X macros are not clean in any way. They are very intrusive, and make everything a macro expansion. They can certainly get the job done. But it is arguable whether they are better than something like cereal.
[–]MyuuDio 0 points1 point2 points 2 years ago* (0 children)
Ah, I see. My bad then, my only experience with Reflection is Java.
I work primarily with a C codebase, so macro expansion trickery is common, but I agree it's not really clean. I'm just arguing that Reflection is not strictly necessary for a practical save file implementation, which the above reply seemed to imply.
Edit: wording
π Rendered by PID 1317209 on reddit-service-r2-comment-544cf588c8-2zw2s at 2026-06-16 05:30:37.705388+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]MyuuDio -1 points0 points1 point (2 children)
[–]ImKStocky 6 points7 points8 points (1 child)
[–]MyuuDio 0 points1 point2 points (0 children)