<<< | Index | >>> |
Classes can have references as members.
Reference replaces pointer and adds design constraints we may need.
Reference member must be initialized early.
In fact, before constructor body is entered!
New syntax for constructors: the initializer list. Consider:
class Point { private: Graph& m_g; int m_x; int m_y; public: Point( Graph& g, int x, int y ); };
<<< | Index | >>> |