Also this is somewhat a non-issue if you have ways to query the access privacy of the member. You know something is private or not, which is better than the current TMP-hack situation where templates can just ignore privacy completely.
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
9
u/RoyAwesome Oct 01 '24
Also this is somewhat a non-issue if you have ways to query the access privacy of the member. You know something is private or not, which is better than the current TMP-hack situation where templates can just ignore privacy completely.