C++11 and the lack of polymorphic lambdas - why?

后端 未结 5 2020
感动是毒
感动是毒 2020-12-08 00:38

I\'ve been reviewing the draft version of the C++11 standard. Specifically the section on lambdas, and I am confused as to the reasoning for not introducing polymorphic lamb

5条回答
  •  难免孤独
    2020-12-08 01:05

    The reason we don't have polymorphic lambdas is explained pretty well in this posting.

    It has to do with the concepts feature that was pulled from C++11: essentially, polymorphic lambdas are ordinary, unconstrained function templates and we didn't know how to typecheck a concept-constrained template that used an unconstrained template. However, solving that problem turns out to be easy as shown here(dead link), so I don't think there's any obstacle remaining.

    The link to cpp-next is dead; the relevant info can be found here

提交回复
热议问题