Is it possible to write c++ template/macros to check whether two functions have the same signatures
问题 Is it possible to write c++ template/macros to check whether two functions have the same signatures (return type and arguments list) ? Here's a simple example of how I want to use it: int foo(const std::string& s) {...} int bar(const std::string& s) {...} if (SAME_SIGNATURES(foo, bar)) { // do something useful... make Qt signal-slot connection for example... } else { // signatures mismatch.. report a problem or something... } So is it possible somehow or is it just a pipe dream ? P.S.