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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham 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!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: "Robert Kawulak" Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Wed, 29 Sep 2004 20:11:46 +0200 Organization: tp.internet - http://www.tpi.pl/ Message-ID: References: <41547dae$0$91007$39cecf19@news.twtelecom.net> <1g2d9xmnita9f.5ecju0eftkqw$.dlg@40tude.net> <1hl2mizeb27ku$.1f0asrbmb05mi.dlg@40tude.net> NNTP-Posting-Host: pr170.krakow.cvx.ppp.tpnet.pl X-Trace: nemesis.news.tpi.pl 1096482490 12281 213.76.42.170 (29 Sep 2004 18:28:10 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Wed, 29 Sep 2004 18:28:10 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:4401 Date: 2004-09-29T20:11:46+02:00 List-Id: Hi, >>> Note that C++ does not solve the >>> problem, because it has no arrays. [...] >> Of course C++ has got arrays inherited from C which are the core language >> construct [...] > Pointers are not arrays. Ah, now I see what you meant! ;-) >>> So it allows you to define [] and leaves >>> you alone with that. It is not the Ada's way (TM). >> >> Again I don't see your point here... As to the C++(R) std::vector<>, >> there >> is operator [] defined. > > An ability to index is just one of many array properties. The whole list > is > very large. As well as the list of methods and operators and other members of std::vector<>... What particular thing are you missing there? > Provocatively, ;-P > I would claim that an instance of std::vector is not an > array. For a type to be an array means that the language has some kind of > array interface defined and thus it can check a type against that > interface > to verify whether the type implements the interface. There is no such > thing > in C++. There is - C arrays. But the definition you wrote shows that you still think the Ada way (TM) - in C++ (R) built-in types and user-defined types are treated the same way. Why you think that it is necessary for the core language to know what is an array and what isn't? In Ada, you can't use anything else than built-in array exactly as an array. In C++ you can. > You can claim that the template std::vector defines such array, > but > then what would you do with My_Template_Array designed independently on > std::vector? It will not be an array then! The Ada way, again - who says there can be one and only one type representing an array? In C++you have C arrays, std::vector<>, std::valarray<> and even std::string - and all these can be treated in uniform way as arrays. > BTW, Ada's Unbounded_String is *not* an array, alas. Fortunately std::string might be considered as a container, which you may use like std::vector in most cases. ;-) Best regards, Robert Kawulak