Say that I have:
template <typename T>
struct Foo {
T& func();
};
And I implement a Foo
: Foo<int> bar
Now I want to get the return type of bar.func()
. I've been trying to force result_of
to work with me but to no avail.
What I'd really like is to just be able to do result_of_t<foo.func>
and be done with it but I imagine it's significantly more difficult? How should I go about getting this return type?
EDIT:
I was hoping to accomplish this without without respect to how bar
was declared. That is to say, I want to just be able to pass bar.func
into result_of
or similar and gt out the return type.