From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd45e29f9dafca87 X-Google-Attributes: gid103376,public From: dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner) Subject: Re: bitwise comparators Date: 2000/01/17 Message-ID: <8605pu$9ic1@news.cis.okstate.edu>#1/1 X-Deja-AN: 573997728 References: <3880D375.7E363123@hotmail.com> <38829638.0@news.pacifier.com> <3882FC1C.2BA8C959@hotmail.com> <85vmn2$ki1$1@nnrp1.deja.com> <38836CF2.AB738B8B@hotmail.com> <388394E0.55D1E913@maths.unine.ch> <38838989.4F158467@hotmail.com> Organization: Oklahoma State University User-Agent: slrn/0.9.6.2 (Linux) Reply-To: dstarner98@aasaa.ofe.org Newsgroups: comp.lang.ada Date: 2000-01-17T00:00:00+00:00 List-Id: On Mon, 17 Jan 2000 22:28:41 +0100, Alexander Van Hecke wrote: >> > use structs and callback functions and you have perfect generic types! >> >> You imagine a rather inefficient way to implement generics. > >As a matter of fact, this way is more efficient than using >templates! Templates have to be copied and filled in -> >lots of overhead. If you use callback functions in structs, >all you have to do is link the correct pointers to the >adresses of the functions and that's it. It sounds like you're complaining about compile time work, which is irrelevant in most cases. Templates are not copied and filled in at runtime. Templates are efficent at runtime, unlike your method, especially for numeric work (you're substituting a call to a function for every addition in the code. That kills performance.) -- David Starner - dstarner98@aasaa.ofe.org If you wish to strive for peace of soul then believe; if you wish to be a devotee of truth, then inquire. -- Friedrich Nietzsche