#include <type_traits>
struct Y{};
struct X{
bool operator()(Y const&);
long operator()(Y&&);
};
Y const f();
int main(){
static_assert(std::is_same<std::result_of<X(Y const)>::type, bool>(), "/cry");
X x;
using result_type = decltype(x(f()));
static_assert(std::is_same<result_type, bool>(), "/yay");
}
I2luY2x1ZGUgPHR5cGVfdHJhaXRzPgoKc3RydWN0IFl7fTsKCnN0cnVjdCBYewogIGJvb2wgb3BlcmF0b3IoKShZIGNvbnN0Jik7CiAgbG9uZyBvcGVyYXRvcigpKFkmJik7Cn07CgpZIGNvbnN0IGYoKTsKCmludCBtYWluKCl7CiAgc3RhdGljX2Fzc2VydChzdGQ6OmlzX3NhbWU8c3RkOjpyZXN1bHRfb2Y8WChZIGNvbnN0KT46OnR5cGUsIGJvb2w+KCksICIvY3J5Iik7CiAgCiAgWCB4OwogIHVzaW5nIHJlc3VsdF90eXBlID0gZGVjbHR5cGUoeChmKCkpKTsKICBzdGF0aWNfYXNzZXJ0KHN0ZDo6aXNfc2FtZTxyZXN1bHRfdHlwZSwgYm9vbD4oKSwgIi95YXkiKTsKfQ==