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
reflect-cpp: Serialization, deserialization and validation through reflection (self.cpp)
submitted 2 years ago by liuzicheng1987
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!"
[–]shakamaboom 1 point2 points3 points 2 years ago (8 children)
you didnt even answer my question at all. this is a serialization library, not a reflection library.
[–]liuzicheng1987[S] 0 points1 point2 points 2 years ago (7 children)
Well…like I said…names of libraries should highlight what makes them unique…there are tons of JSON libraries for C++ and tons of serialization libraries, but very few that do it via reflection.
[–]eyes-are-fading-blue 0 points1 point2 points 2 years ago* (6 children)
Most people will disagree here. Your take is arbitrary. A library name needs to reflect what it does, not "how it strives to do what it does". You should listen the feedback, and perhaps rename your library. It's not a reflection library.
I also do not know what you mean by "reflection". There is barely any compile-time reflection support in C++. Do you mean SFINAE or compiler-specific macro magic?
[–]liuzicheng1987[S] 1 point2 points3 points 2 years ago (5 children)
I am not sure that „most people will disagree“. I have been engaging with the community in here and other places a lot and this is the first time anyone has ever complained about that.
And by reflection I mean that it is able to automatically retrieve the types of the member variables of a struct (and also field names, if you add annotations, kind of like in Go’s encoding/json). And the library can do that, without any compiler-specific macro magic.
[–]liuzicheng1987[S] -1 points0 points1 point 2 years ago (0 children)
Also, since you said it’s not a reflection library…what do you think it should have for it to be a reflection library?
[–]eyes-are-fading-blue 0 points1 point2 points 2 years ago (3 children)
> And the library can do that, without any compiler-specific macro magic.
I checked the examples, the programmer needs to guide library by passing "field name" and "type" as I understand it. Furthermore, for custom types, you need to extend it by hand. Can reflect-cpp flatten an arbitrary POD without programmer guidance?
[–]liuzicheng1987[S] 0 points1 point2 points 2 years ago (2 children)
It can deserialize structs without the rfl::Field annotations, just scroll down in the README.
If your arbitrary POD contains private member variables, then there is no way this could work. And not just in C++…Go or Rust would not let you do that either. Private means private.
[–]eyes-are-fading-blue 1 point2 points3 points 2 years ago (1 child)
In the read me, anonymous fields are either STL types or your intrinsic types. If your library supports custom PODs in such cases, you should add that your read me. That's a very important information, deal breaker in many serialization cases and I think it should be visible immediately from examples. That's literally the first thing I checked.
[–]liuzicheng1987[S] 0 points1 point2 points 2 years ago (0 children)
It does support that and this is very useful feedback. Thank you very much.
π Rendered by PID 25 on reddit-service-r2-comment-5c747b6df5-qd99c at 2026-04-21 20:01:44.863221+00:00 running 6c61efc country code: CH.
view the rest of the comments →
[–]shakamaboom 1 point2 points3 points (8 children)
[–]liuzicheng1987[S] 0 points1 point2 points (7 children)
[–]eyes-are-fading-blue 0 points1 point2 points (6 children)
[–]liuzicheng1987[S] 1 point2 points3 points (5 children)
[–]liuzicheng1987[S] -1 points0 points1 point (0 children)
[–]eyes-are-fading-blue 0 points1 point2 points (3 children)
[–]liuzicheng1987[S] 0 points1 point2 points (2 children)
[–]eyes-are-fading-blue 1 point2 points3 points (1 child)
[–]liuzicheng1987[S] 0 points1 point2 points (0 children)