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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a64004e5f547b1ed X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-17 11:07:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0900.news.uu.net!reader0901.news.uu.net!not-for-mail Message-ID: <3D0E2559.1080909@mail.com> Date: Mon, 17 Jun 2002 14:07:21 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1a) Gecko/20020614 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: more to ada paper critic References: <4519e058.0206170923.5b278bfe@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Cache-Post-Path: master.nyc.kbcfp.com!unknown@fixedcost.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1024337242 reader1.ash.ops.us.uu.net 16843 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:26169 Date: 2002-06-17T14:07:21-04:00 List-Id: Ted Dennison wrote: > This must be a C++ idiom with which I'm unfamiliar. I thought C++ > class declarations did not allow any part of the class's declaration > (like one of its fields) to be declared in a separate compilation. You're right. I think he's talking about the so-called "pimpl" technique, which isolates the implementation of a class into a file which is never seen by the user. The user only sees a class which has a set of methods, and one pointer to an implementation class. //-----widget.h------- class WidgetImpl; // forward declare class class Widget { auto_ptr pImpl; // OK for WidgetImpl to be incomplete type public: Widget(); void method1(); void method2(); }; //-----widget.cpp----- class WidgetImpl { public: void method1() { } void method2() { } }; Widget::Widget() : pImpl(new WidgetImpl) { } void Widget::method1() { pImpl->method1(); } void Widget::method2() { pImpl->method2(); }