#include <iostream>
using namespace std;

struct Foo {
	int meth() { return 13; }
};

int main() {
	auto func = &Foo::meth;
	decltype((declval<Foo>().*func)()) bar = 42;
	
	cout << bar << endl;
}