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,27dc164946031512 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.vmunix.org!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!kanaga.switch.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Limited_Controlled and constructor functions Date: Mon, 22 Jan 2007 09:59:16 +0100 Organization: CERN News Message-ID: References: <1qu3xfyfc024$.phvronbnfx6j.dlg@40tude.net> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: cernne03.cern.ch 1169456356 23841 137.138.37.241 (22 Jan 2007 08:59:16 GMT) X-Complaints-To: news@@cern.ch NNTP-Posting-Date: Mon, 22 Jan 2007 08:59:16 +0000 (UTC) User-Agent: Thunderbird 1.5.0.9 (X11/20061220) In-Reply-To: <1qu3xfyfc024$.phvronbnfx6j.dlg@40tude.net> Xref: g2news2.google.com comp.lang.ada:8392 Date: 2007-01-22T09:59:16+01:00 List-Id: Dmitry A. Kazakov wrote: >> In C++ it's two lines of code or even half: >> >> class MyClass : boost::noncopyable >> ... > > Huh, C++ has even weaker means to describe formal types contracts. It has > dire . In Ada there is limited, tagged, range <> etc. Far too > weak, IMO, but still better than C++. Yes, except that I'm not suprised by what C++ offers with regard to class definitions. I was very surprised by the semantics of Controlled and Limited_Controlled and their funny effects on other parts of my program. >> > send them over IP... >> >> Then we're talking about serialization. > > Egh, no, serialization is ordering in time. You are right. Me too: http://en.wikipedia.org/wiki/Serialization > To be able to copy is about > lack of identity and memory-isotropy. Not really. Memory isotropy (cool technical buzz, btw ;-) ) is about memcpy and memmove. Copy semantics is about what happens when you use relevant language constructs. If memory isotropy is a property of any given type, then copy semantics can be automatically derived. Otherwise it has to be explicitly defined. >> Limited types don't forbid it. > > Limited types is a kludge. A particularly nasty one. > There should be a simpler and clearer way to say > that the thingy has no visible compiler-generated copy constructor, no > equality, no aggregates, no assignment Amen. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/