Thread overview
Strange behavior of typedef
Jan 27, 2004
Matthias Becker
Jan 29, 2004
Walter
Jan 29, 2004
Matthias Becker
January 27, 2004
class MyClass {}
typdef MyTypedef {}
class MyDerived : MyClass {}
class MyTypedefDerived : MyTypedef {}

int main ()
{
MyClass foo = new MyDerived();  // works fine
MyTypedef bar = new MyTypedefDerived();  // doesn't work :(


return 0;
}


January 29, 2004
"Matthias Becker" <Matthias_member@pathlink.com> wrote in message news:bv5i4g$1g73$1@digitaldaemon.com...
> class MyClass {}
> typdef MyTypedef {}

I don't know what you meant to happen here, but "typdef" should be "typedef", and the syntax is for a class declaration, not a typedef.


> class MyDerived : MyClass {}
> class MyTypedefDerived : MyTypedef {}
>
> int main ()
> {
> MyClass foo = new MyDerived();  // works fine
> MyTypedef bar = new MyTypedefDerived();  // doesn't work :(
>
>
> return 0;
> }
>
>


January 29, 2004
>"Matthias Becker" <Matthias_member@pathlink.com> wrote in message news:bv5i4g$1g73$1@digitaldaemon.com...
>> class MyClass {}
>> typdef MyTypedef {}
>
>I don't know what you meant to happen here, but "typdef" should be "typedef", and the syntax is for a class declaration, not a typedef.

Sorry, I ment.

class MyClass {}
typdef MyClass MyTypedef;

Damn. I had this at home, but hadn't have the time to report it. So I did it the next day at work (so I caouldn't use copy&paste).


>
>> class MyDerived : MyClass {}
>> class MyTypedefDerived : MyTypedef {}
>>
>> int main ()
>> {
>> MyClass foo = new MyDerived();  // works fine
>> MyTypedef bar = new MyTypedefDerived();  // doesn't work :(
>>
>>
>> return 0;
>> }
>>
>>
>
>