3 ms·
You should safely shoot yourself in the foot with `friend`, which is a core language feature for accessing private members/functions/etc. https://www.cpprefere
by jjmarr 1y ago
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 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.