Open BjarneStroustrup opened 3 years ago
I think we need a rule banning reference members. All we have is a note: (Note that using a reference member is almost always wrong.)
Related/Duplicate: #1707
We have this in C.12 so perhaps a PR to propose updates to that?
I’m curious why this is desirable? Aren’t reference members (passed as constructor parameters) a perfectly valid way to do dependency injection in C++?
I think we need a rule banning reference members. All we have is a note: (Note that using a reference member is almost always wrong.)