From -6847250831500693605
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,229c1f24fca43638,start
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-08-02 12:41:00 PST
Path: bga.com!news.sprintlink.net!news.onramp.net!convex!cs.utexas.edu!usc!nic-nac.CSU.net!charnel.ecst.csuchico.edu!olivea!inews.intel.com!cad563!etse
From: etse@scdt.intel.com (Eric Tse)
Newsgroups: comp.std.c++
Subject: dynamic_cast<T> question
Date: 2 Aug 1994 16:45:31 GMT
Organization: Intel
Lines: 29
Message-ID: <31lt7b$c0m@inews.intel.com>
NNTP-Posting-Host: cad563.intel.com
X-Newsreader: TIN [version 1.2 PL2]

Hi,

	I wonder if I could do a safe down cast of the
following using dynamic_cast<T> keyword:

class B {..};
class D : public B {..};
class G : public D {..};

void f(){
	B* b = 0;
	D* d = 0;
	G* g = new G();

	b = g;

	d = dynamic_cast<D*>(b);
	...
}

	Thanks.

Eric

--
---------------------------------------------------
Eric Tse			etse@scdt.intel.com
Intel Corporation		     (408) 765-8453
---------------------------------------------------


