NoFear

导航

2012年3月16日

摘要: View Code 当成员函数为const时 constness(常量性)bitwise constness:不更换对象内任何一个字节,编译器判断成员变量没有赋值动作即可。不足:class test{public: char& operator[](size_t index) const { return mPointer[index]; } test(const char* str) { mPointer = new char[strlen(str)+1]; memcpy(mPointer,str,strlen(str)... 阅读全文

posted @ 2012-03-16 17:49 Fear_Hao 阅读(1009) 评论(0) 推荐(0) 编辑