3 ms·
C++ has "friend" classes, a quirky feature I've never seen in another language. But which solves this very problem.
by wavemode 3y ago
C++ has "friend" classes, a quirky feature I've never seen in another language. But which solves this very problem.
- sanderjd 3y agoIt's not much different that package-private (the default visibility in java).
- brabel 3y agoWe use package-private and @VisibleForTesting (I forget which library provides that now) for these cases.
- sanderjd 3y ago@VisibleForTesting is mostly documentation; you can just as easily use package private without an annotation. (Though yeah, I think it's good to use the annotation anyway.)