From -2052909659686235611 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,2c058f2002bfcf32 X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2003-02-13 08:44:44 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull From: Nicola.Musatti@ObjectWay.it (Nicola Musatti) Newsgroups: comp.std.c++ Subject: Re: proposal: better support for IS_IMPLEMENTED_IN_TERMS_OF Date: Thu, 13 Feb 2003 16:44:17 +0000 (UTC) Organization: http://groups.google.com/ Lines: 89 Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++) Message-ID: References: <110220031511499473%acappellaguy@hotmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: mail2news.demon.co.uk 1045154657 6761 10.0.0.1 (13 Feb 2003 16:44:17 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 13 Feb 2003 16:44:17 +0000 (UTC) X-Received: from mulga.cs.mu.oz.au ([128.250.1.22]) by news.demon.co.uk with esmtp (Exim 4.05) id 18jMT9-0001ku-00 for mail2news@news.news.demon.net; Thu, 13 Feb 2003 16:44:15 +0000 X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU id DAA19414; Fri, 14 Feb 2003 03:44:11 +1100 (EST) X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Path: comp-std-cpp-robomod!not-for-mail X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-Delivered-To: std-c++@ncar.ucar.edu X-Newsgroups: comp.std.c++ X-NNTP-Posting-Date: 13 Feb 2003 10:08:11 GMT X-Spam-Status: No, hits=-8.4 required=5.0 tests=NOSPAM_INC,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01 version=2.41 Xref: archiver1.google.com comp.std.c++:17939 acappellaguy@hotmail.com (A Cappella Guy) wrote in message news:<110220031511499473%acappellaguy@hotmail.com>... > I apologize that I do not have a specific, detailed proposal in mind, > just a couple areas where I believe the language could help better > model the IS_IMPLEMENTED_IN_TERMS_OF relationship. I'm hoping to open > up a dialogue. > > 1) Extend using. > > I would like to see the using keyword bring selected methods of > privately-inherited or contained implementation classes into the main > interface of a class. Something like: > > class Foo : private Bar { > public: > using Bar::A; > using Bar::B; > using m_Impl.C; > using m_Impl.D; > private: > Impl m_Impl; > }; Note that the part concerning private base classes is already part of the language. As to implement a form of syntactic short hand for delegation by means of the using keyboard, I have to say that I already posted this same proposal on the newsgroup some time ago, without receiving much feedback. In my intention you should be able to do the following (I'm rewriting your example just to clarify what is meant by the A's, B's, etc. above): class A { public: int f(); int g(); }; class B { public: int h(); }; class C { public: using a; // exposes all of A's public member functions using a.f; // exposes only the named member using b->g; private: A a; B * b; }; Note that in case of overloads, all the overloaded functions would be exposed. [...] > 2) Public const, private non-const > > Automatic support for publicizing the const members of an > implementation class, keeping non-const members private. Here I have > an actual example: > > class Directory { > public: > Directory(const std::string& path); > void Refresh(); > using const m_Contents; > private: > std::vector m_Contents; > }; I think this is also reasonable, even though it's not as straight an extension of the meaning of the using keyword as the above one. Note however that this is just a special case of extending 'using' to allow the selection of specific overloads, which is also an issue with the current uses of the using keyword. Cheers, Nicola Musatti --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]