1 在開發維護代碼的過程中,對構造、析構函數的修改比較頻繁,所以將它們的實現放在.cpp文件中
2 保證 operator = 的不變性,保證對象不會處于部分構造狀態:
???通常的技巧就是:
???T& T::operator = (const T& rhs) {
??????T temp(rhs);
??????this->swap(temp);???// 實現swap
??????return *this;
???}
3 整數轉字符(int convert to string)
???std::string itos_ctm(int num) {
??????std::stringstream s;
??????s<<num;
??????return s.str();
???}
(to be continued)