Can I write a function type that returns a function?
问题 The following fails to compile on both gcc and clang #include <type_traits> int foo(); int main() { using R = std::result_of_t<decltype(foo)()>; // error } The error on both compilers deals with the illegality of declaring a function returning a function. But I'm not declaring such a function - I'm just trying to write its type - since that's what result_of expects. Is this really still ill-formed? 回答1: You're passing a type-id , which is defined in [dcl.name] as […] syntactically a