struct Div { int i; int j; }; class A { public: A(); Div& divs; };
In my constructor definition, I have
Keep in mind that once a reference is initialized to point to something, you cannot alter it to point to something else. If this is not the desired behavior, then you should use a pointer or a copy of the object instead.