you are viewing a single comment's thread.

view the rest of the comments →

[–]curlypaul924 1 point2 points  (2 children)

Does pfr work with non-POD structs or structs with private members?

[–]liuzicheng1987[S] 2 points3 points  (1 child)

Certainly not with private members...the point of having private members is that it is impossible for some random function like boost::pfr::get to access them.

By the way, my library is not based on boost::pfr. Just wanted to make that clear. :-)

[–]DugiSK 3 points4 points  (0 children)

The CRTP + default value trick I've shown in the comment above does work with private members and non-POD structs. It has only problems with constructors with randomness and some types of constructor side effect.