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

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

We have:

  • std::plus (+)
  • std::minus (-)
  • std::multiplies (*)
6条回答
  •  别跟我提以往
    2021-02-05 05:59

    All of the ones listed are two-argument functors. Not all of the ones below are. In fact, only >>, <<, &, |, and != fulfill that criterion, and are just a little less useful in terms of functors. The casts especially are templates, which makes them a little less useful.

提交回复
热议问题