digitalmars.D.learn - alias & typedef
- Heinz (4/4) Jan 09 2007 Hi,
- Kirk McDonald (21/27) Jan 09 2007 Aliases provide another name for an existing type. Typedefs declare a
- Bill Baxter (5/9) Jan 09 2007 I think the spec is pretty clear:
- Frits van Bommel (4/15) Jan 10 2007 And read the next few sections too.
Hi, I just wan't to know the differences between 'alias' and 'typedef' as both do the same thing. Thanks
Jan 09 2007
Heinz wrote:Hi, I just wan't to know the differences between 'alias' and 'typedef' as both do the same thing. ThanksAliases provide another name for an existing type. Typedefs declare a new type which happens to be identical to an existing type. This can matter in function overloading, for instance: alias int IntAlias; typedef int IntTypedef; void main() { int i = 1; IntAlias j = 2; IntTypedef k = 3; } -- Kirk McDonald Pyd: Wrapping Python with D http://pyd.dsource.org
Jan 09 2007
Heinz wrote:Hi, I just wan't to know the differences between 'alias' and 'typedef' as both do the same thing.I think the spec is pretty clear: http://www.digitalmars.com/d/declaration.html#typedef Have you read that yet? --bb
Jan 09 2007
Bill Baxter wrote:Heinz wrote:And read the next few sections too. For example, nobody has yet mentioned that alias is useful for more than just types.Hi, I just wan't to know the differences between 'alias' and 'typedef' as both do the same thing.I think the spec is pretty clear: http://www.digitalmars.com/d/declaration.html#typedef Have you read that yet?
Jan 10 2007