Is this a valid way to create an assignment operator with members that are references?
#include struct A { int &ref; A(int &Ref)
Another solution is to use the reference_wrapper class ( in functional header ) :
struct A { A(int& a) : a_(a) {} A(const A& a) : a_(a.a_) {} A& operator=(const A& a) { a_ = a.a_; return *this; } void inc() const { ++a_; } std::reference_wrappera_; };