News for hackers. Stuff that matters.
Re:Public/protected/private is an unnecessary feature by jjmarr on Thursday June 19, 2025 @05:18PM (#44322610)
You should safely shoot yourself in the foot with `friend`, which is a core language feature for accessing private members/functions/etc.

https://www.cppreference.com/w/cpp/language/friend.html

Redefining public as private can violate the ODR rule and triggers undefined behaviour because private members are ordered in memory in an undefined way, while public members are ordered in a standard way.

There are no comments on this comment yet.