C++ class that mandates const objects

后端 未结 5 2009
盖世英雄少女心
盖世英雄少女心 2021-01-16 05:23

First let me ask a general question:

  • It seems to me that C++ is a language whose point is to provide tons of capabilities, to give the programmer the greatest
5条回答
  •  广开言路
    2021-01-16 06:27

    Your first paragraph details how C++ is flexible and allows you to express many different programs.

    Your second paragraph asks why C++ doesn't allow a programmer to enforce a highly stringent limitation that is of questionable benefit (when you can simply mark all the members const to achieve almost the same result).

    Let us each draw our own conclusions from this dichotomy. :)

提交回复
热议问题