From -5375150255415280877
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,18c6d861cef54158
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-01-02 23:02:07 PST
Path: archiver1.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: abarbati@iaanus.com (Alberto Barbati)
Newsgroups: comp.std.c++
Subject: Re: automatic downcast support through function parameters
Date: Fri, 3 Jan 2003 07:02:03 +0000 (UTC)
Organization: Newsfeeds.com http://www.newsfeeds.com 80,000+ UNCENSORED Newsgroups.
Lines: 49
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <3e14cc85_4@corp.newsgroups.com>
References: <23478c42.0212310830.23dbc580@posting.google.com> <3E120608.6060608@tellabs.com> <23478c42.0301020923.79359e66@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 1041577323 22077 10.0.0.1 (3 Jan 2003 07:02:03 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Fri, 3 Jan 2003 07:02:03 +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 18ULqC-0005jo-00
	for mail2news@news.news.demon.net; Fri, 03 Jan 2003 07:02:01 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id SAA13251; Fri, 3 Jan 2003 18:01:56 +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 23:35:07.0015 (UTC) FILETIME=[951B5170:01C2B2B7]
X-Spam-Status: No, hits=-12.6 required=5.0
	tests=IN_REP_TO,NOSPAM_INC,QUOTED_EMAIL_TEXT,REFERENCES,
	      SPAM_PHRASE_02_03,USER_AGENT,USER_AGENT_MOZILLA_UA,
	      X_ACCEPT_LANG
	version=2.41
Xref: archiver1.google.com comp.std.c++:16674

danielgutson@hotmail.com wrote:
> 1) [To Kalle]: Yes, I'm talking about the second: a kind of condition
> using RTTI. The advantage -and I'm not the best for asserting this as
> far as I'm not in quality of implementations- is that -I think- this
> can be achieved using a reduced set of RTTI primitives. I think, that
> in fact RTTI is no needed (as a whole), despite any run time
> information is needed in some kind. I think that this can be achieved
> just with some additional entry in the v-table.
> What if a null pointer is passed: the null pointer contains no
> information, what means that it wasn't upcasted, it's just an
> 'original null pointer to base', then the g(Base*) should be called
> (btw, your 'else' works).

Whatever the syntax, the main problem is to select one specific 
overloaded function among a set of function with the same name *at 
runtime*. But RTTI (as it is now) holds information about classes, not 
about functions. You need a completely new set of RTTI information, not 
a reduced version of current one. Moreover, as Philippe points out, this 
set might not be available when dynamic linking is used.

By the way, how would you handle situations with more than one 
parameter? I mean:

void g(Base* b1, Base* b2);
void g(Base* b, Der* d);
void g(Der* d, Base* b);

void f(upcasted Base* b1, upcasted Base* b2)
{
    g(b1, b2); // which g?
}

Remember that the decision must be taken at runtime, so the compiler 
can't give you an error message.

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                       ]



