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

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

We have:

  • std::plus (+)
  • std::minus (-)
  • std::multiplies (*)
6条回答
  •  北恋
    北恋 (楼主)
    2021-02-05 06:10

    The bitwise operators are added in C++0x. I also find not_equal_to already present.

    Others, like sizeof and some casts are compile time operators so would be less useful in a functor.

    New and delete are abstracted in allocators. Do we need more of that?

提交回复
热议问题