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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f2ce8bda9cae4ab X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!news.ks.uiuc.edu!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: "Must instantiate controlled types at library level." Why? Date: Fri, 14 May 2004 13:58:02 -0400 Organization: Hades Message-ID: References: <13392802.3gDeTK7ybb@linux1.krischik.com> <2780491.NPbR8AFya6@linux1.krischik.com> <11924003.IfRfnULeIG@linux1.krischik.com> <1676457.GMYvKY1ieA@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.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Xref: controlnews3.google.com comp.lang.ada:588 Date: 2004-05-14T13:58:02-04:00 List-Id: "Georg Bauhaus" wrote in message news:c82vhe$ecp$2@a1-hrz.uni-duisburg.de... > Xenos wrote: > : > : Wrong. C++ has a string class in its standard library. Its a lot more > : versitile than Ada's String type. > > It would be more fair I think if you compared > Standard.Strings.Unbounded > to > std::string > > C++ minus the STL, if I may put it this way, has no Ada-like or STL-like > arrays after all. (But it does have an STL.) I'll give you that one, though I don't think its fair to weigh a language without considering its library. The C++ philosophy (and I won't argue its correctness) is to put anything that can be in the library in there and not in the language. Though admittedly I was probably guilt of the same comparing std::string to String. > > > :> Also you use pointers because C/C++ has no "out" or "in out". Ada however > :> decides itself if call by value or call by reference is needed. So no > :> pointers needed here as well. > : Wrong. C++ has reference types are equivalent to "in out." Constant > : reference types may be used for "in." > > My understanding of Martin's comment is that you can have an Ada > compiler decide whether it thinks that pass by reference is better, > thus you only need to specify the mode, not the passing mechanism. > Is there a similar allowance for C++ compilers? The comment I argued against stated that in C++ you *had* to use pointers because the language *didn't* have anything like "in out" which is simply untrue. In C++, pointers are almost as unnecessary as they are in Ada. I won't argue whether it is better for the compiler to decide when to use pass by reference. > > > -- Georg