#ifndef MAXTYPED_H #define MAXTYPED_H // NOTE: This macro creates code implementing a function. // The function has name max_. // The user of this macro will have to invoke it for each type // specific implementation s/he wants to use. Then s/he needs // to explicitly invoke the method that is created. (Ugh...) // Because we're creating code, there will be runtime overhead for // the procedure call. #define maxTypedTemplate(type) \ type max_ ## type ( type a, type b ) { \ return ( a>b ? a : b ); \ } #endif // MAXTYPED_H