using a typedefed variable with library classes

Charles Hixson charleshixsn at earthlink.net
Sat Jan 10 15:23:31 PST 2009


Is it possible to use a typedefed variable with library classes?

In particular, what I've done is:

typedef  int  TestType;
TestType  t;
File      f;

t = 42;
f.write (t);

And the response I get is the compiler asking whether I want to write 
bytes or a long.

Am I doing something grossly wrong?  Or is typedef just broken?  Or is 
it really supposed to work that way for some not-understood reason?
(alias works fine...but this seems to make typedef basically useless. 
Unless there's a way of adding functions to the library classes [like 
file] so that they'll understand how to cast the typedefed variable.)


More information about the Digitalmars-d-learn mailing list