4 ms·
There is yet another thing with deducing this: no more pointer-to-members: ``` class A { int f(this A & self, float b); }; ``` Type of &A::f is int ()(A &,
by germandiago 3y ago
There is yet another thing with deducing this: no more pointer-to-members:
```
class A {
int f(this A & self, float b);
};
```
Type of &A::f is int ()(A &, float), not int (A::)(float).
This is huge for template metaprogramming function deduction if you stick to it because that generated a lot of template instantiations to cover all cases.
- quotemstr 3y agoBut then you'll break if someone supplies a "real" member function. Is this even a big deal with std::invoke, which lets us treat regular functions and PMFs uniformly?
- germandiago 3y agostd::invoke I am guessing it could somewhat instantiate quite a bit of code? Not sure thoug. But it is a template signature. And it is not the only problem with pointers to members. When doing signature introspection you need a ton of combinatoric template specializations. Getting rid of a family of instantiations by sticking to deducing this seems like an attractive approach.