What is the reason for `std::result_of` deprecated in C++17?

后端 未结 2 1179
时光说笑
时光说笑 2020-12-15 18:47

I saw std::result_of is being deprecated in C++17.

  • What is the reason for std::result_of deprecated in C++17?
  • Also I would
2条回答
  •  一向
    一向 (楼主)
    2020-12-15 19:31

    T.C. already provided the obvious link, but perhaps the most horrific reason bears repeating: result_of involved forming the type F(Arg1, Arg2, ...) not for a function of those types returning F but for a function of type F accepting those types. (After all, the return type is the result of, well, result_of, not the input!)

    Aside from the adjustments associated with forming the function type, the only difference between the two is syntactic.

提交回复
热议问题