3 ms·
Same here. I recently came across a real use for the newer `private protected` (`FamANDAssembly`) modifier combo. Only derived types that are internal to my ass
by nick_ 1y ago
Same here. I recently came across a real use for the newer `private protected` (`FamANDAssembly`) modifier combo. Only derived types that are internal to my assembly can access this member. Beautiful. It re-confirmed my long standing belief that OOP is an incredibly powerful and valid pattern.
- kmeisthax 1y agoI'm assuming this is akin to Rust's pub(crate) keyword?
- colejohnson66 1y ago`internal` maps to `pub(crate)`. But there's no analog for `protected` because Rust doesn’t have inheritance. `private protected` means "only me or anyone inheriting me in this assembly". There's also `protected internal` which means "me, anyone inheriting me, and anyone inside this assembly". An assembly is analogous to a Rust crate.