All pastes #1746649 Raw Edit

FP to Default Parameter Fn

public cpp v1 · immutable
#1746649 ·published 2010-01-11 09:24 UTC
rendered paste body
/* Pointer to Functions with Default Parameters */#include <cstdio>void foo(int x = 0, int y = 0) {    if(x && y);  // Only to keep the compiler happy    puts("void foo(int, int)");}void (*fp_int_int)(int, int) = foo;void (*fp_int_int_2)(int = 0, int = 0) = foo; // This won't doint main() {    fp_int_int(0, 0);}