Originally Posted by
Elysia
IF you don't pass by reference, the entire string will be duplicated.
If you pass by reference, the object will not be duplicated. More efficient.
There's no need for const if you don't pass by reference because we use it to protect unwanted changes to the original object.
You can't. The design is simply flawed.
If B is stored in A, then you must use a public interface.
In other words, you may "own" a car, but you still can't access its internals. You must use its public interface (it, pedestals and wheel) to drive it.
This is different from a is-a relationship where a cat is an animal and should therefore be able to access the animal's basic properties.