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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56131a5c3acc678e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-08 11:41:22 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!tiscali!newsfeed1.ip.tiscali.net!feed.news.tiscali.de!newsfeed.stueberl.de!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.rapidnet.com!news.rapidnet.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 08 Dec 2003 13:41:20 -0600 Date: Mon, 08 Dec 2003 13:36:03 -0600 From: Chad Bremmon Reply-To: bremmon@acm.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Question about OO programming in Ada References: <5JmdnUF_9o_ABE-iRTvUrg@rapidnet.com> <1273941.m4G3ZzughP@linux1.krischik.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.13.119.21 X-Trace: sv3-xwt/EUVZR3vKsLuCuPoYqKNfghNWynuClyVcBWyQhF9dYHYtOKHoOX2G/XD+TMeRAuUif1GDZVGS9+O!W6tjcbT9ts2//MKvp7BIcFifeQkENq2LzApp5KBufp8NHjK3c5QLBrvE+l9Q7ucuSBAdDTX8FIj/ X-Complaints-To: abuse@rapidnet.com X-DMCA-Complaints-To: abuse@rapidnet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:3241 Date: 2003-12-08T13:36:03-06:00 List-Id: Georg Bauhaus wrote: > What difference does your compiler produce from the following two > files? > > testX.cc: > > struct X { int a; }; > > testY.cc: > > class Y {public: int a;}; The overhead that I'm referring to doesn't come into play until you call a function on a class The way object oriented programming works, is there is an implicit parameter always passed to any function of a C++ class. It is done explicitly in Ada 95, usually with a this paramter. Obviously there is no runtime overhead with a declaration, because there are no instructions associated with a declaration. The calls to class functions usually involve runtime dispatching in a C++ class, they very seldom require dispatching in an Ada95 class. But, if you're going to just write declarations, there is no overhead, becuase it doesn't do anything either way.