Usefulness of const (C++)

前端 未结 6 1033
眼角桃花
眼角桃花 2021-01-18 23:43

I\'m a const fiend, and I strive to make everything as const as possible.

I\'ve tried looking at various dissassembly outputs from const and non const versions of fu

6条回答
  •  情话喂你
    2021-01-19 00:33

    The purpose of const is primarily an architectural one. When you declare something as const you should actually be thinking on what it represents: something that cannot change.

提交回复
热议问题