5
멤버 변수를 클래스 멤버로 참조
제 직장에서는이 스타일이 광범위하게 사용되는 것을 봅니다. #include <iostream> using namespace std; class A { public: A(int& thing) : m_thing(thing) {} void printit() { cout << m_thing << endl; } protected: const int& m_thing; //usually would be more complex object }; int main(int argc, char* argv[]) { int myint = …