typedef Replacement?

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
J

Jonathan Wood

I would like some code to use a particular type of variable but have the
option to change it to another type of variable.

I assume I can use #define. Any chance there's a replacement for typedef?

Thanks.
 
Jonathan said:
I would like some code to use a particular type of variable but have the
option to change it to another type of variable.

I assume I can use #define.
No.

Any chance there's a replacement for typedef?

Not really.

Using generics and polymorphism is probably your best choice.

Arne
 
You can use 'Imports' aliases.
e.g.,
Imports BigInt = System.Int64
....
Dim x As BigInt

But other developers will hate you since that's not what 'Imports' is
intended for.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# or VB to C++/CLI
 
Forgot which forum I was in....
In C#, you can do the following:
using BigInt = System.Int64;
....
BigInt x;

But, as I mentioned, other developers will despise you.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# or VB to C++/CLI
 
Perhaps I meant 'shun' (or maybe they'll just dump garbage on your desk).
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# or VB to C++/CLI
 
Doesn't seem quite right, somehow, to use generics or polymorphism to define
simple integer data types.
 
Thanks for the input.

I guess that's yet another item I must give up when moving from C++ to C#.
 
Back
Top