j*****k 发帖数: 1198 | 1 effective c++里面说:
In particular, if the object this points to is truly const, i.e., was
declared const at its point of definition, the results of casting away its
constness are undefined. If you want to cast away constness in one of your
member functions, you'd best be sure that the object you're doing the
casting on wasn't originally defined to be const.
这儿是不是指如果the object is originally defined to be a const, the casted
result can not be used as lvalue? 如果是这样的话,下面就可以理解了。如果不是
,那是什么意思呢?
size_t st | d*****a 发帖数: 110 | 2 //ft, it makes me dizzy to see the mix-up of c char* and c++ string... |
|