Using closure in function scope to make "real" private class members

Dom Disc dominikus at scherkl.de
Wed Jun 8 08:41:36 UTC 2022


On Wednesday, 8 June 2022 at 08:23:31 UTC, Max Samukha wrote:
> That is just as abominable, given friends are rare in 
> "properly" designed OOP code.

Not in C++. E.g. operator overloads with the class as second 
operand but some basic type as first operand _can't_ be member 
functions (because C++ doesn't have op_right). But operators tend 
to really need access to the innards, so most of the time they 
have to be friends. And there are many operators, hence many 
friends...


More information about the Digitalmars-d mailing list