Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Stateless lambdas do convert implicitly to function-pointers, no problem. Commented Oct 13, 2020 at 0:46
  • @Deduplicator true, except we are in a template context. Unless the type is already a pointer or follows an automatic conversion path, the template won't recognise it. Lambdas have auto generated user conversions, which is why an explicit cast works. Commented Oct 13, 2020 at 4:41
  • 1
    @Kain0_0 We're in a class template, not a member template. It converts fine for int The problem is the return type isn't T Commented Oct 13, 2020 at 10:16