Xref: utzoo comp.lang.c:34840 comp.lang.c++:10825 Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ncar!dinl!noren From: noren@dinl.uucp (Charles Noren) Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: Programming Challenge Message-ID: <1809@dinl.mmc.UUCP> Date: 18 Dec 90 19:15:56 GMT References: <1990Dec15.015355.15683@fmrco> Reply-To: noren@dinl.UUCP (Charles Noren) Organization: Martin Marietta I&CS, Denver CO. Lines: 26 In article maguire@sun.soe.clarkson.edu (Bill Maguire) writes: >In article <1990Dec15.015355.15683@fmrco> harold@fmrco (Harold Naparst) writes: > >>I am trying to write a function which will return the index >>of the smallest element of an array. I want the routine >>to work for any type array. That is, I don't want to write >>a separate routine for each type of array (real or double or >>integer). How can I do this ? I tried playing around with >>the GNU C typeof operator, but couldn't figure it out. Any ideas ? > >>Harold Naparst > >Two ways immediately pop to mind: ...or you could wait until AT&T implements Parameterized Types, or use (AT YOUR OWN RISK) one of the C++ compilers that has a version Parameterized Types (e.g., the C++ that comes with ObjectStore OODBMS by Object Design, Inc). -- Chuck Noren NET: dinl!noren@ncar.ucar.edu US-MAIL: Martin Marietta I&CS, MS XL8058, P.O. Box 1260, Denver, CO 80201-1260 Phone: (303) 971-7930