Martin Vermeer <[EMAIL PROTECTED]> writes:
| On Wed, Oct 30, 2002 at 04:24:30PM +0100, Lars Gullik Bjønnes wrote:
>>
>> So people... are you ready for a small RTTI survy?
>>
>> compile this prog and run it:
>
| [[EMAIL PROTECTED]:~]$ rpm -q gcc
| gcc-2.95.2-7cl
>
>
| [[EMAIL PROTECTED]:~]$ g++ x
On Wed, Oct 30, 2002 at 04:24:30PM +0100, Lars Gullik Bjønnes wrote:
>
> So people... are you ready for a small RTTI survy?
>
> compile this prog and run it:
[[EMAIL PROTECTED]:~]$ rpm -q gcc
gcc-2.95.2-7cl
[[EMAIL PROTECTED]:~]$ g++ x.C
[[EMAIL PROTECTED]:~]$ ./a.out
(nil)
0x8049f80
(nil)
0
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
Lars> So people... are you ready for a small RTTI survy?
Lars> compile this prog and run it:
cxx 6.2 says:
fantomas: cxx -std strict_ansi testrtti.C -o testrtti
fantomas: ./testrtti
0
14001b480
0
14001b480
So I think it works.
J
John Levon <[EMAIL PROTECTED]> writes:
| On Wed, Oct 30, 2002 at 04:24:30PM +0100, Lars Gullik Bjønnes wrote:
>
>> later we can even use exceptions: (Bø! Skvatt du nå?)
>
| If you want to use exceptions we may as well return AInset & then.
we might.
>> try {
>> AInset * a =
On Wed, Oct 30, 2002 at 04:24:30PM +0100, Lars Gullik Bjønnes wrote:
> later we can even use exceptions: (Bø! Skvatt du nå?)
If you want to use exceptions we may as well return AInset & then.
> try {
> AInset * a = inset->asType();
> a->someAFunction();
> }
John Levon <[EMAIL PROTECTED]> writes:
| On Wed, Oct 30, 2002 at 04:00:51PM +0100, Lars Gullik Bjønnes wrote:
>
>> and I didn't really understand the complete Andre method. Care to give
>> me a recap?
>
| class Base {
>
| virtual AInset * asAInset() { return 0 }
| virtual BInset * asB
On Wed, Oct 30, 2002 at 04:00:51PM +0100, Lars Gullik Bjønnes wrote:
> and I didn't really understand the complete Andre method. Care to give
> me a recap?
class Base {
virtual AInset * asAInset() { return 0 }
virtual BInset * asBInset() { return 0 }
virtual CInset * as
John Levon <[EMAIL PROTECTED]> writes:
| On Wed, Oct 30, 2002 at 03:51:22PM +0100, Lars Gullik Bjønnes wrote:
>
>> AInset * a2 = i->asType();
>> BInset * b2 = i->asType();
>>
>> _but_ I guess a lot of complier have problems with RTTI...
>
| Right, but if we move to Andre's method in the
On Wed, Oct 30, 2002 at 03:51:22PM +0100, Lars Gullik Bjønnes wrote:
> AInset * a2 = i->asType();
> BInset * b2 = i->asType();
>
> _but_ I guess a lot of complier have problems with RTTI...
Right, but if we move to Andre's method in the meantime, the upgrade
to use proper dyn cast wi
Andre Poenitz <[EMAIL PROTECTED]> writes:
>> John Levon <[EMAIL PROTECTED]> writes:
>>
>> | I much prefer Andre's way. Compare
>> |
>> |InsetSomething * i = inset->asSomethingInset();
>> |if (!i)
>> |break;
>> |
>> | with
>> |
>> |if (inset->lyxCode() == SOMETHING_CODE) {
>
> John Levon <[EMAIL PROTECTED]> writes:
>
> | I much prefer Andre's way. Compare
> |
> | InsetSomething * i = inset->asSomethingInset();
> | if (!i)
> | break;
> |
> | with
> |
> | if (inset->lyxCode() == SOMETHING_CODE) {
> | InsetSomething * i = static_cast(i)
John Levon <[EMAIL PROTECTED]> writes:
| I much prefer Andre's way. Compare
|
| InsetSomething * i = inset->asSomethingInset();
| if (!i)
| break;
|
| with
|
| if (inset->lyxCode() == SOMETHING_CODE) {
| InsetSomething * i = static_cast(i);
|
John Levon <[EMAIL PROTECTED]> writes:
| I much prefer Andre's way. Compare
|
| InsetSomething * i = inset->asSomethingInset();
| if (!i)
| break;
|
| with
|
| if (inset->lyxCode() == SOMETHING_CODE) {
| InsetSomething * i = static_cast(i);
|
I much prefer Andre's way. Compare
InsetSomething * i = inset->asSomethingInset();
if (!i)
break;
with
if (inset->lyxCode() == SOMETHING_CODE) {
InsetSomething * i = static_cast(i);
...
}
Does anyone have a problem
14 matches
Mail list logo