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: fac41,15edb893ef79e231 X-Google-Attributes: gidfac41,public X-Google-Thread: f4fd2,23202754c9ce78dd X-Google-Attributes: gidf4fd2,public X-Google-Thread: 103376,15edb893ef79e231 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,15edb893ef79e231 X-Google-Attributes: gid114809,public X-Google-ArrivalTime: 2002-01-18 15:48:55 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.lisp,comp.lang.ada,comp.lang.eiffel,comp.lang.smalltalk Subject: Re: True faiths ( was Re: The true faith ) Date: Fri, 18 Jan 2002 18:53:32 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <%njZ7.279$iR.150960@news3.calgary.shaw.ca> <3c36fbc5_10@news.newsgroups.com> <4idg3u40ermnp682n6igc5gudp7hajkea9@4ax.com> <76be8851.0201101909.9db0718@posting.google.com> <9jtu3u8cq92b05j47uat3412tok6hqu1ki@4ax.com> <3C3F8689.377A9F0F@brising.com> <3219936759616091@naggum.net> <3C483CE7.D61D1BF@removeme.gst.com> <3C4863C5.6040406@mail.com> <3C48AE35.BA38ED04@adaworks.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.lisp:24701 comp.lang.ada:19088 comp.lang.eiffel:5464 comp.lang.smalltalk:18189 Date: 2002-01-18T18:53:32-05:00 List-Id: "Richard Riehle" wrote in message news:3C48AE35.BA38ED04@adaworks.com... > In C++ or Ada (or whatever) there is no need to write an assignment > operator unless the assignment between two objects is more complex > than predefined assignment. One benefit of the limited type in Ada is > to highlight the dangers of assignment. This is also why most complex > data structures in Ada are limited types. That's why I routinely turn off copy-assignment and copy-construction in my ADTs: class C { public: C(); //... private: C& operator=(const C&); C(const C&); //... }; I recently had to override assignment for a type, but that was only for a class sans vtable (the type wasn't "tagged"). Fortunately, I haven't had to overrided assignment for a tagged type. > This specification makes clear the contract and still eliminates any > possibility for stupid assignment between objects of the type. What I showed above is the standard C++ idiom for doing the same.