From -6506800202944825068
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,229c1f24fca43638
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-08-08 03:09:50 PST
Newsgroups: comp.std.c++
Path: bga.com!news.sprintlink.net!hookup!yeshua.marcam.com!usc!howland.reston.ans.net!EU.net!sun4nl!cwi.nl!olaf
From: olaf@cwi.nl (Olaf Weber)
Subject: Re: dynamic_cast<T> question
In-Reply-To: Philip@storcomp.demon.co.uk's message of Thu, 4 Aug 1994 17:38:36 +0000
Message-ID: <Cu7GCp.FBo@cwi.nl>
Lines: 29
Sender: news@cwi.nl (The Daily Dross)
Nntp-Posting-Host: havik.cwi.nl
Organization: CWI, Amsterdam
References: <31lt7b$c0m@inews.intel.com> <776021916snz@storcomp.demon.co.uk>
Date: Mon, 8 Aug 1994 07:19:30 GMT

In article <776021916snz@storcomp.demon.co.uk>, Philip@storcomp.demon.co.uk (Philip Hugh Hunt) writes:

> Would this work:

> class A {...};
> class B {...};
> /* Both A and B include virtual functions */

> class C: public A, public B {...};

> void f()
> {
>    A* a;
>    C* c = new C;
>    B* b;
   
>    a = c;
>    b = dynamic_cast<B*>(a);  
>    ...
> }

Yes.  Details are given in the chapter on ANSI/ISO resolutions found
in newer printings of Stroustrup2e and the ARM (subsection 5.2.6).
The latest version of that text for Stroustrup2e is available on the
net as:
	ftp://ftp.std.com/AW/stroustrup2e/iso.ps
it is dated May 3 1994.

-- Olaf Weber


