I have a number of C++ functions void f()
, R g(T a)
, S h(U a, V b)
and so on. I want to write a template functi
template
typename std::result_of::type
wrapper(Args&&... args) {
return fn(std::forward(args)...);
}
#define WRAPPER(FUNC) wrapper
//Usage:
int min(int a, int b){
return (a
#include
int main(){
std::cout<
Alternatively, to get maybe quite less readable, but shorter syntax:
#define WRAPPER(FUNC, ...) wrapper(__VA_ARGS__)
//Usage:
int main(){
sdt::cout<