Correct usage(s) of const_cast<>

后端 未结 8 814
陌清茗
陌清茗 2020-12-02 14:23

As a common rule, it is very often considered a bad practice to use const_cast<>() in C++ code as it reveals (most of the time) a flaw in the design.

8条回答
  •  死守一世寂寞
    2020-12-02 14:47

    const_cast is also used to remove volatile modifiers, as put into practice in this (controversed) article:

    http://www.drdobbs.com/184403766

提交回复
热议问题