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,9eef6c480abeecf8 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!skynet.be!newspost001!tjb!not-for-mail Date: Fri, 11 Feb 2005 16:50:31 +0100 From: Adrien Plisson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: fr-fr, fr-be, fr, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Dynamic array allocation and STL equivalents? References: <1108127216.221977.60830@o13g2000cwo.googlegroups.com> <13r5d1sfsg55d$.1u0p9rdnt3zcy.dlg@40tude.net> In-Reply-To: <13r5d1sfsg55d$.1u0p9rdnt3zcy.dlg@40tude.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <420cd447$0$23755$ba620e4c@news.skynet.be> Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 07b5d2b0.news.skynet.be X-Trace: 1108137031 news.skynet.be 23755 81.243.84.198:3679 X-Complaints-To: usenet-abuse@skynet.be Xref: g2news1.google.com comp.lang.ada:8244 Date: 2005-02-11T16:50:31+01:00 List-Id: Dmitry A. Kazakov wrote: > Index of a multi-dimensional array is a tuple. That won't work in C++ (you > cannot override "," to support: A[i,j,k]). Neither works it in Ada. in C++, you can override "," ("," is an operator as any others). but you should really not do this: some people use this operator extensively for brevity or just because they want to put multiple expressions where they should only put one (eg, in the condition of a "if" statement). but you may override operator [] to take a parameter of type std::vector, as suggested by the OP. it may render the element access syntax not obvious, but it is comparable to the Ada solution you wrote. -- rien