Arity of a generic lambda

前端 未结 5 1265
说谎
说谎 2020-12-01 23:53

It is possible to deduce arity of a non-generic lambda by accessing its operator().

template 
struct fInfo : fInfo

        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 00:31

    It's impossible, as the function call operator can be a variadic template. It's been impossible to do this forever for function objects in general, and special-casing lambdas because they happened to not be equally powerful was always going to be a bad idea. Now it's just time for that bad idea to come home to roost.

提交回复
热议问题