This looks like a trivial question for me, maybe I didn't find the right documentation..
I have a struct A, and I want to define parameter b to be of return type of function A:
struct A{
int operator[](int);
};
and then at some point
decltype(A::operator[]) b = 0;
I could do this: but it's ugly..
A a;
decltype(a[0]) b = 0;
(it can be double / int etc), I don't want to use templates.
Thanks,
I don't quite understand the need, other than playing with the syntax. That is precisely what
auto
was designed for, andauto
is supported by the same standard that addeddecltype
...At any rate, you need to simulate the function call: