https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85707

--- Comment #8 from Mathias Stearn <redbeard0531 at gmail dot com> ---
>  If the constructor had other side-effects (e.g., count
>  the number of objects of the class) bypassing it could
>  violate the invariant.

I thought one of the points of friendship was to allow friends to violate a
class's invariants temporarily as long as they promise that the class is left
in a valid state in the end. Since presumably a class and its friends are
maintained by the same people, they are aware of what the actual requirements
of the class are, even if they can't be stated precisely in the language today.

Reply via email to