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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!Spring.edu.tw!news.nctu.edu.tw!feeder.seed.net.tw!attdv1!attdv2!ip.att.net!newsfeed1.global.lmco.com!svlnews.lmms.lmco.com!not-for-mail From: "Xenos" Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Wed, 29 Sep 2004 08:01:10 -0400 Organization: Hades Message-ID: References: <1777528.JKnUEYTOM6@linux1.krischik.com> <1ec946d1.0409230820.455ad242@posting.google.com> <3673998.bj16mkkOu2@linux1.krischik.com> <1700922.2nPlMsa4Ny@linux1.krischik.com> <3750337.aJMmIeXcav@linux1.krischik.com> <3060085.UHp9MgIIe7@linux1.krischik.com> NNTP-Posting-Host: 158.187.64.144 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Xref: g2news1.google.com comp.lang.ada:4376 Date: 2004-09-29T08:01:10-04:00 List-Id: "Martin Krischik" wrote in message news:3060085.UHp9MgIIe7@linux1.krischik.com... > typedef explicit int My_Int. > > And that means that > > typedef Ada :: Range US_Hours; > typedef Ada :: Range Month; This problem can be overcome by adding a "unique class" to your template if you want them to be distinuished: class default_class {}; template Range class Range; Now if you need the range to be a new type: class hours_range {}; class month_range; typedef Range Hours; typedef Range Month; They are now unique classes. > > are the same for C++. But there are not in real live. And if I use: > > class US_Hours Ada :: Range {}; > class Month Ada :: Range {}; > > I loose the constructors. So there is still something to be improved. Not true! You cannot use initializer lists if the class has a constructor. This is where Ada and C++ differ.