Re: Using functions for MAX and MIN limitsthierusability.

From: Nielsen (
Date: 04/23/01


> Would it not be better if it were passed and returned a long, though so
> that it would be compatible with longs on 16 bit platforms?  Or maybe
> compilers would complain too much about the implicit conversion from long
> to something less than long on the return?


template<class T>
inline const T &max(const T &arg1, const T &arg2)
  return (arg1 > arg2 ? arg1 : arg2);

If you're using C++.

Jon A. Nielsen
Lazarus of Spear of Insanity MUD

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/05/01 PST