항목 20 : 클래스 동작 원리 (난이도 7)
이번 항목은 보다 전문가적 스타일에 중점을 두었으며, 이 원리를 이해 한다면, 더 유지보수가 편하고 견고한 클래스 디자인에 도움이 될 것이다. 다음 코드를 보자. // 예제코드 class Complex { public: Complex( double real, double imaginary = 0 ) : _real( real ), _imaginary( imaginary ) { } void operator+ ( Complex other ) { _real = _real + other._real; _imaginary = _real + other._imaginary; } void operator
책 정리/Exceptional C++
2008. 10. 18. 16:47
최근댓글