MISRA Discussion Forums

Full Version: Can I get by with a little help from My Friends?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Rule 11-0-1 states,
Quote:Member data in non-POD class types shall be private.
with the rationale:
Quote:By implementing class interfaces with member functions, the implementation retains more control over how the object state can be modified, and helps to allow a class to be maintained without affecting clients.
Does the above mean non-POD structure types should not contain any friend declarations? A friend declaration would by definition allow for the circumvention of the access restrictions.
There are no restrictions on the use of “friend” access within POD or non-POD structures.