现在的位置: 首页 > 综合 > 正文

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

2013年01月21日 ⁄ 综合 ⁄ 共 610字 ⁄ 字号 评论关闭
 
   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.

抱歉!评论已关闭.