Why can't operator () of stateless functor be static?

前端 未结 5 1032
我在风中等你
我在风中等你 2020-12-15 19:51

Why is operator () of stateless functor not allowed to be static? Stateless lambda objects are convertible to pointers to free functions having the

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-15 20:10

    I would think that there's no technical reason to forbid this (but not being familiar with the de-facto cross-vendor C++ ABI (Itanium ABI), I can't promise anything).

    There's however an evolutional issue about this at https://cplusplus.github.io/EWG/ewg-active.html#88 . It even has the [tiny] mark on it, making it a somewhat "trivial" feature under consideration.

提交回复
热议问题