2008 August 13th Wednesday (八月 十三日 水曜日)

来源:互联网 发布:淘宝店铺行业排名层级 编辑:程序博客网 时间:2024/05/16 06:36
 
   The "const_cast" is not all powerful.  It can change the pointer access to a quantity, but the effect of
attempting to change a quantity that is declared "const" is undefined.

  Why we use the operator?  The reason for this operator is that occasionally you may have a need for value that
is constant most of the time but which can be changed occasionally.  For customer or caller, it is a constant,
for implementer, it must be alter on possible occasion.  This could be done using the general cast, but the general
cast can also simultaneously change the type.

  Many a programmer usually is puzzled by some features of C++ language.  Some operator, virual functions, and so on.
Every feature in C++ language is assigned to a purpose.

原创粉丝点击