【操作符重载】等号的两种形式
摘要:
1.void operator= (const SomeClass& C) {....}2.SomeClass& operator= (const SomeClass& C) {....return *this;}结论:Both are legal and probably have the same performance.The problem with #1 is that it does't emulate the builtin operator=which is generally regarded as bad style.来源:http://by 阅读全文
posted @ 2012-05-24 11:25 LateStop 阅读(2383) 评论(0) 推荐(0)
浙公网安备 33010602011771号