[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: C++ help, please...
From:       "Tomas Mecir" <mecirt () gmail ! com>
Date:       2006-05-30 13:12:57
Message-ID: 492258b10605300612m582e4a2dj596e4cf991c0fb4f () mail ! gmail ! com
[Download RAW message or body]

On 5/30/06, Thomas Zander <zander@kde.org> wrote:
> On Tuesday 30 May 2006 14:34, Tomas Mecir wrote:
> > int main() {
> > C *c = new C;
> > A *a = dynamic_cast<A*>(c);
> > B *b = dynamic_cast<B*>(a);
> > cout << ((b != 0) ? "b is not NULL" : "b is NULL") << endl;
> > return 0;
> > }
>
> This worked here as well; hence my confusion.
>
> If you, however; pass 'a' to another class (in another file) and _there_
> cast it to B it will fail. Apparently C++ does more compile time then it
> should.

I'd say, file a bugreport for gcc, the behaviour should be the same,
no matter how many files you split the code to.

/ Tomas
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic