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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f2ce8bda9cae4ab X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!green.octanews.net!news-out.octanews.net!news-out.visi.com!petbe.visi.com!news.octanews.net!ash.uu.net!spool.news.uu.net!not-for-mail Date: Mon, 17 May 2004 11:01:06 -0400 From: Hyman Rosen User-Agent: Mozilla Thunderbird 0.5 (Windows/20040502) X-Accept-Language: en MIME-Version: 1.0 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> <87lljuvd6j.fsf@insalien.org> <874qqgpjok.fsf@insalien.org> <3tVpc.34871$vz5.29965@nwrdny01.gnilink.net> <2004517-94829-360098@foorum.com> In-Reply-To: <2004517-94829-360098@foorum.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1084806067.140519@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1084806067 20618 204.253.250.10 Xref: controlnews3.google.com comp.lang.ada:639 Date: 2004-05-17T11:01:06-04:00 List-Id: Ludovic Brenta wrote: > Yes, that is what I meant. Basically, std::vector<> does not > eliminate the problems inherent to C++ arrays; it only provides a > workaround. OK, suppose I add these four lines to my code: template struct array { T a[N]; T &operator[](unsigned i) { return i < N ? a[i] : throw i; } }; Now I can declare my array, for example, as array, and pass it around by value. I haven't used #include. > Hyman also said that a programmer who would have a std::vector* > pointing to an array of vectors would be a stupid programmer. I > agree, but this is another form of the oft-heard argument that "any > good programmer", etc. which it is not convincing to me. No, that's not at all what I said. I said that no programmer would have a native array of vectors, because it's a completely unnatural thing to do. I also said that because of this, only a stupid programmer would consider this to be a valid argument against C++.