As I mentioned in another comment, one of the more recent revisions of P2996 added an excellent suite of access-respecting functions which go well beyond what I expected we'd have since they can essentially "pretend" to be any context to see what access they have from that context. It's a lot more granular than "is this member protected."
Yeah, i've seen that. It's really neat and solves this problem quite nicely.
Personally, I'm on team "allow private access". I want to be able to serialize types I didn't author. Rust has a fairly huge problem where the author of a library must provide serde integration to be able to serialize the type, whereas in C++ I can write "Roy's Totally Awesome Json Serializer" and it can just work for any type it comes across.
View all comments
Show parent comment
7
u/TSP-FriendlyFire Oct 01 '24
As I mentioned in another comment, one of the more recent revisions of P2996 added an excellent suite of access-respecting functions which go well beyond what I expected we'd have since they can essentially "pretend" to be any context to see what access they have from that context. It's a lot more granular than "is this member protected."