<minmax.h>
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
<algorithm>
template<class T> inline const T& (max)(const T& a, const T& b) {return (b < a ? a : b);}
template<class T> inline const T& (min)(const T& a, const T& b) {return (b < a ? b : a);}
So, with <minmax.h> if you write
int rec(x){
...
return max( rec(y), rec(z) );
}
you call rec(y) and rec(z) twice because last line of code is preprocessed to
return rec(y) > rec(z) ? rec(y) : rec(z);
Edited by author 18.03.2012 08:04