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=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9cccf6ef6149fdaa X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Ada Date: 2000/01/04 Message-ID: <84t8b1$ar5$1@nnrp1.deja.com>#1/1 X-Deja-AN: 568161303 References: <38620350.48F8FC08@gecm.com> <83tohh$q2s$1@nnrp1.deja.com> <83u8l0$5i5$1@nnrp1.deja.com> <84rd2f$snm$1@nntp3.atl.mindspring.net> X-Http-Proxy: 1.0 x31.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Tue Jan 04 16:49:43 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-01-04T00:00:00+00:00 List-Id: In article , Hyman Rosen wrote: > C++ provides excellent implementation of generics, The trouble with templates is that there is no equivalent of the generic contract model, and also it is very difficult to implement generic sharing of code. These are both issues which the Ada model regards as essential, so certainly by Ada standards, the above statement is controversial. > and good implementation of overloading OUCH! The rules for overloading in C++ are fiersomely complex, far more so than in Ada, due to the interaction with implicit conversions (something that Ada avoids), and the consequent need for complex preference rules. In my experience, almost no C++ programmers can tell you what the rules are, and many people run into trouble with these rules. > except that > one cannot overload on return type as in Ada. A pretty big gap! It means for example that if you have multiple implementations of sets, that you cannot have a parameterless function Empty that returns the (appropriate) empty set. > Is there something specific you believe you can not > do in C++ with regard to these abilities? Yes, see the above, in particular, to summarize: 1. Share generic code at the object level 2. Be sure your template is correct *before* you use it 3. Understand the overloading rules 4. Overload on return type Sent via Deja.com http://www.deja.com/ Before you buy.