Think you know the basic C++ code patterns implementing the five UML class relationships? Try this simple test.
class A { }; class B : public A { };
class B { A* a; }; class A { B* b; };
class B { }; class A { B* b; };
class B { }; class A { B b; };
class A { public: T func1(B b) {...} T func2(B* b) {...} T func3(B& b) {...} };
class A { T func4() { B b; b.function(); } };