In your case there is no guarantee of exclusion. (This is basically case 0). The Wikipedia article you are quoting is understandable: "Rules apply to class implementations." Also, after you have chosen, the variable j goes beyond the scope and no longer exists. You can’t even talk about your address anymore, not to mention the meaning
Typically, class invariants are determined by the author of the class, so it means everything that the class author has in mind. I do not understand your point 1. NULL is a valid value for a pointer.
The second point is good. The definition is not absolute. For example, an operation on a string data item may increase its capacity. You can watch it outside through const& . However, this throughput is usually not considered as part of the string value and, therefore, is not part of the class invariant.
Msalters
source share