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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,66fae8c862b81b17 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Received: by 10.224.111.140 with SMTP id s12mr2670921qap.5.1351953257213; Sat, 03 Nov 2012 07:34:17 -0700 (PDT) Received: by 10.52.28.45 with SMTP id y13mr836580vdg.10.1351953257193; Sat, 03 Nov 2012 07:34:17 -0700 (PDT) Path: gf5ni18188417qab.0!nntp.google.com!c7no4714841qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 3 Nov 2012 07:34:17 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=77.65.97.192; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S NNTP-Posting-Host: 77.65.97.192 References: <1aWdnbcg_8-BzAzNnZ2dnUVZ_j6dnZ2d@giganews.com> <559eb706-9bb1-496d-9034-1984d693531a@googlegroups.com> <5460fdc7-5490-4889-b771-67cc281c10c5@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Copy vector in Ada From: Maciej Sobczak Injection-Date: Sat, 03 Nov 2012 14:34:17 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Date: 2012-11-03T07:34:17-07:00 List-Id: W dniu sobota, 3 listopada 2012 00:45:55 UTC+1 u=C5=BCytkownik Hibou57 (Yan= nick Duch=C3=AAne) napisa=C5=82: > > Similarly in C++ - if the assignment operator is too costly (or just = =20 > > impossible) to implement, there is a way to ban it. >=20 > Really? That's a hot news to me. At least at the time I used it (~ 2000),= =20 > there was nothing like that, Then you should prepare for an even hotter news: it was "there" always. > And I'm not even sure there was a way to redefine the copy operation It was "there" always. The ability to redefine copy operation is a fundamen= tal part of data abstraction. You would not even be able to implement such = basic things like a string class without this functionality. =20 I would even say that C++ has a more elegant solution for this problem, as = the ability to redefine the assignment operation is orthogonal to other par= ts of the language and does not interfere with things like polymorphism. Al= so, banning and redefining are handled in the consistent way (hey, they *ar= e* related issues!), while in Ada these two are done in completely distinct= ways - one requires a keyword, while the other requires a derivation from = some magic type. Yuck. --=20 Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com