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 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!news2.telebyte.nl!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Wed, 29 Sep 2004 10:08:43 +0200 Message-ID: <1hl2mizeb27ku$.1f0asrbmb05mi.dlg@40tude.net> References: <41547dae$0$91007$39cecf19@news.twtelecom.net> <1g2d9xmnita9f.5ecju0eftkqw$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de scAjqG0jRLbM93UPwcuM8gT/5SmsUnlxBq4AXPh3Z8xSUoA9c= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:4362 Date: 2004-09-29T10:08:43+02:00 List-Id: On Tue, 28 Sep 2004 19:21:04 +0200, Robert Kawulak wrote: >> Note that C++ does not solve the >> problem, because it has no arrays. > > What exactly do you mean by that? I suppose it's some kind of metaphore... > > Of course C++ has got arrays inherited from C which are the core language > construct, and std::vector<> which is safe and dynamic-sized version of an > array. Pointers are not arrays. >> 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. Provocatively, 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++. 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! BTW, Ada's Unbounded_String is *not* an array, alas. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de