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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f2ce8bda9cae4ab X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news-spur1.glorb.com!news.glorb.com!newsfeed1.ip.tiscali.net!tiscali!transit1.news.tiscali.nl!dreader2.news.tiscali.nl!not-for-mail Sender: lbrenta@deuteronomy Newsgroups: comp.lang.ada Subject: Re: "Must instantiate controlled types at library level." Why? References: <13392802.3gDeTK7ybb@linux1.krischik.com> <2780491.NPbR8AFya6@linux1.krischik.com> <11924003.IfRfnULeIG@linux1.krischik.com> <1676457.GMYvKY1ieA@linux1.krischik.com> <1616198.O4tUV8TdF7@linux1.krischik.com> From: Ludovic Brenta Date: 15 May 2004 00:47:32 +0200 Message-ID: <87lljuvd6j.fsf@insalien.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tiscali bv NNTP-Posting-Date: 15 May 2004 00:46:18 CEST NNTP-Posting-Host: 83.134.238.44 X-Trace: 1084574778 dreader2.news.tiscali.nl 41749 83.134.238.44:34283 X-Complaints-To: abuse@tiscali.nl Xref: controlnews3.google.com comp.lang.ada:597 Date: 2004-05-15T00:46:18+02:00 List-Id: "Xenos" writes: > Arrays in C/C++ are not first-class citizens and cannot be functions > parmeters. Saying foo(int x[]) does not define x as an array type, > so of course sizeof x will equal sizeof(int*). Well, I think that that was the whole point Martin was making. In Ada, arrays *are* first-class citizens. However you want to present things, sooner or later you will have to concede that C++ "arrays" create whole classes of potential problems which simply do not exist in Ada. The std::vector template class is not a first-class citizen, and therefore inherits all the problems; you may very well have a std::vector* which really points to an array of vectors, and you'd be back to square one. -- Ludovic Brenta.