// 4_4.h // Implementation of the maximum and minimum functions // C ++ standard library section 4.4 namespace my_minmax {template <class T> inline const T & min (const T &, const T & B) {return B <? B: A;} template <class T> inline const T & MAX (const T & A, const T & B) {return a <B? B: A;} template <class T, class compare> inline const T & min (const T & A, const T & B, compare comp) {return comp (B, a )? B: A;} template <class T, class compare> inline const T & MAX (const T & A, const T & B, compare comp) {return comp (, B )? B: A;} bool int_ptr_less (int * a, int * B) {return * A <* B ;}} // 4_4.cpp # include <iostream> # include "4_4.h" using namespace my_minmax; int main () {int A = 1; int B = 2; int * pA = &; int * pb = & B; STD: cout <min (a, B) <STD: Endl; STD: cout <* min (Pa, Pb, int_ptr_less) <STD: Endl; // The implementation of this min function is interesting STD: cout <min (a, B) + 10 <STD: Endl; // The Return Value of the min function is of the reference type. It can be either the right or the left, for example, min (a, B) = 10}