Article View: alt.comp.lang.learn.c-c++
Article #380Re: Function Templates
From: Mohand - Areski
Date: Sun, 07 Mar 1999 00:00
Date: Sun, 07 Mar 1999 00:00
15 lines
1170 bytes
1170 bytes
template <class T> const T& Max(const T& t1, const T& t2,const T& t3)
{
return ( (t1 > t2) ? ( (t1>t3) ? t1 : t3 ) ) : ( (t2>t3) t2 : t3 ) )
};
Eric & Tammy <emckinniss@sprintmail.com> wrote in message
01be6806$77c8e6a0$LocalHost@mckinniss...
>I need to write a "template function" (i.e., template <class highest>)that
>returns the largest of three numbers of the same type passed to it as
>arguments. Any help, suggestions, or ideas would be appreciated.
>
>
Technical Details
Message-ID:
<7bsev6$4ea$1@uranium.btinternet.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<01be6806$77c8e6a0$LocalHost@mckinniss>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8d38,a166b609beeb1a7f X-Google-Attributes: gidf8d38,public X-Google-Thread: 109fba,a166b609beeb1a7f X-Google-Attributes: gid109fba,public X-Google-Thread: 114592,a166b609beeb1a7f X-Google-Attributes: gid114592,public From: "Mohand - Areski" <Areski.Iberrakene@btinternet.com> Subject: Re: Function Templates Date: 1999/03/07 Message-ID: <7bsev6$4ea$1@uranium.btinternet.com> X-Deja-AN: 452043110 References: <01be6806$77c8e6a0$LocalHost@mckinniss> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0707.2700 Organization: BT Internet Newsgroups: alt.comp.lang.learn.c-c++,borland.public.cpp.language,comp.lang.c++