struct Div { int i; int j; }; class A { public: A(); Div& divs; };
In my constructor definition, I have the following implementation
A::A(): divs(NULL) {}
I get the following error:
Error72 error C2354: 'A::divs' : initialization of reference member requires a temporary variable
class A { Div & ref(Div div) { return div; } public: A() : divs(ref(Div())) {}; Div& divs; };