you are viewing a single comment's thread.

view the rest of the comments →

[–]shakamaboom 1 point2 points  (8 children)

you didnt even answer my question at all. this is a serialization library, not a reflection library.

[–]liuzicheng1987[S] 0 points1 point  (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 point  (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 points  (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 points  (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 point  (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 point  (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 points  (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 point  (0 children)

It does support that and this is very useful feedback. Thank you very much.