Inferring the call signature of a lambda or arbitrary callable for “make_function”

前端 未结 3 741
既然无缘
既然无缘 2020-11-28 09:01

In some situations it\'s desirable to be able to type-erase a callable (e.g. function, function pointer, object instance with operator(), lambda, mem_fn

3条回答
  •  死守一世寂寞
    2020-11-28 09:07

    Impossible. You may be able to take the address of operator() for some types, but not for an arbitrary callable, because it may well have overloads or template parameters. Whether or not it would work for a lambda is most assuredly not well-defined, AFAIK.

提交回复
热议问题