목록copy constructor (1)
일상 코딩
[C++/9.09] 복사 생성자, 복사 초기화 반환값 최적화
Copy Constructor return Value Optimization #include #include using namespace std; class Fraction { private: int m_numerator; int m_denominator; // private 영역으로 넣게되면 복사가 안되게 된다. // Fraction(const Fraction &fraction) // copy constructor // : m_numerator(fraction.m_numerator), // m_denominator(fraction.m_denominator) // { // // 복사 생성자가 얼마나 자주 생성이되는지 알아보는 출력 코드 // cout
C++/따배C++ 09강 연산자 오버로딩
2021. 10. 31. 02:00