From -6164833261265457145
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,18c6d861cef54158
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-01-02 11:17:04 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!NewsITBone-GARR!news.mailgate.org!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: abarbati@iaanus.com (Alberto Barbati)
Newsgroups: comp.std.c++
Subject: Re: automatic downcast support through function parameters
Date: Thu, 2 Jan 2003 19:17:00 +0000 (UTC)
Organization: Newsfeeds.com http://www.newsfeeds.com 80,000+ UNCENSORED Newsgroups.
Lines: 56
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <3e14211b$1_4@corp.newsgroups.com>
References: <23478c42.0212310830.23dbc580@posting.google.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: mail2news.demon.co.uk 1041535020 16215 10.0.0.1 (2 Jan 2003 19:17:00 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Thu, 2 Jan 2003 19:17:00 +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 18UApu-0004DO-00
	for mail2news@news.news.demon.net; Thu, 02 Jan 2003 19:16:59 +0000
X-Received: by mulga.cs.mu.OZ.AU
	id GAA04086; Fri, 3 Jan 2003 06:16:47 +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-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; it-IT; rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en, it
X-Newsgroups: comp.std.c++
X-Comments: This message was posted through Newsfeeds.com
X-Comments2: IMPORTANT: Newsfeeds.com does not condone, nor support,  spam or any illegal or copyrighted postings.
X-Comments3: IMPORTANT: Under NO circumstances will postings containing illegal or copyrighted material through this service be tolerated!!
X-Report: Please report illegal or inappropriate use to <abuse@newsfeeds.com>
X-Abuse-Info: Please be sure to forward a copy of ALL headers, INCLUDING the body (DO NOT SEND ATTACHMENTS)
X-OriginalArrivalTime: 02 Jan 2003 11:23:36.0375 (UTC) FILETIME=[643F2470:01C2B251]
X-Spam-Status: No, hits=-7.3 required=5.0
	tests=INVALID_MSGID,IN_REP_TO,NOSPAM_INC,REFERENCES,
	      SPAM_PHRASE_01_02,USER_AGENT,USER_AGENT_MOZILLA_UA,
	      X_ACCEPT_LANG
	version=2.41
Xref: archiver1.google.com comp.std.c++:16642

danielgutson@hotmail.com wrote:
>  What you think?

What's the point in defining f taking a Base* if I mean Derived*? (or at 
least I mean Derived* for overloading resolution). In other words: why 
should I choose this syntax instead of declaring f taking a Derived*?

What about Base having more than one derived class? For example if

   struct Base{};
   struct Der1 : Base{};
   struct Der2 : Base{};

   void g(Base* b);
   void g(Der1* d);
   void g(Der2* d);

   void f(upcasted Base* b)
   {
     g(b); // which g?
   }

What if one or more derived classes are incomplete at the point of 
declaration of f? For example:

   struct Base{};
   struct Der;

   void g(Base* b);
   void g(Der* d);

   void f(upcasted Base* b)
   {
     g(b); // which g?
   }

   struct Der : Base{};

If I have to give one frank opinion, I would say that this syntax is 
both useless, error-prone and difficult for a compiler to implement 
correctly. Maybe I'm not understanding it correctly...

Alberto



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

---
[ 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                       ]



