Synopsis: | A public method must never return a non-const reference or pointer to data outside an object, unless the object shares the data with other objects |
Language: | C++ |
Severity Level: | 2 |
Category: | Object Oriented Programming |
Description: |
Although, the data exists outside the object it is still part of the state of the object. The calling method should not be able to manipulate this data. |