Re: Using functions for MAX and MIN limitsthierusability.

From: Nielsen (nielsenje@home.com)
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?

Alternatively:

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
http://spear.kilnar.com/
telnet://spear.kilnar.com:1066/

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



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