Why do several of the standard operators not have standard functors?

后端 未结 6 1073
庸人自扰
庸人自扰 2021-02-05 05:15

We have:

  • std::plus (+)
  • std::minus (-)
  • std::multiplies (*)
6条回答
  •  说谎
    说谎 (楼主)
    2021-02-05 06:22

    Most likely, nobody on the Standard committee thought that they would be useful. And with C++0x's lambda support, then none of them are useful.

    Edit:

    I'm not saying that they have no use- more that nobody on the Committee actually thought of that use.

提交回复
热议问题