Lambda Expression vs Functor in C++

后端 未结 8 773
予麋鹿
予麋鹿 2020-12-05 00:01

I wonder where should we use lambda expression over functor in C++. To me, these two techniques are basically the same, even functor is more elegant and cleaner tha

8条回答
  •  鱼传尺愫
    2020-12-05 00:25

    As you pointed out, it works best when you need a one-off and the coding overhead of writing it out as a function isn't worth it.

提交回复
热议问题