digitalmars.D.learn - typedef '?
- seany (4/4) Nov 20 2013 is typedef gone?
- evilrat (4/8) Nov 20 2013 it is replaced with alias.
- Dicebot (2/11) Nov 20 2013 Those are not equivalent. Alias does not create new type.
- bearophile (7/11) Nov 20 2013 There is a Typedef implemented in Phobos. In some cases it works,
- Jesse Phillips (7/11) Nov 20 2013 typedef was removed from the language, there were reasonable
is typedef gone? http://forum.dlang.org/thread/aqsjjrtzfzslcopabqgs forum.dlang.org?page=2 so If I want to define a new type as typedef string[] surrealNumber, then it does not work?
Nov 20 2013
On Wednesday, 20 November 2013 at 10:49:19 UTC, seany wrote:is typedef gone? http://forum.dlang.org/thread/aqsjjrtzfzslcopabqgs forum.dlang.org?page=2 so If I want to define a new type as typedef string[] surrealNumber, then it does not work?it is replaced with alias. so for ur case this would looks like "alias string[] surrealNumber;" or "alias surrealNumber = string[];"
Nov 20 2013
On Wednesday, 20 November 2013 at 10:54:31 UTC, evilrat wrote:On Wednesday, 20 November 2013 at 10:49:19 UTC, seany wrote:Those are not equivalent. Alias does not create new type.is typedef gone? http://forum.dlang.org/thread/aqsjjrtzfzslcopabqgs forum.dlang.org?page=2 so If I want to define a new type as typedef string[] surrealNumber, then it does not work?it is replaced with alias. so for ur case this would looks like "alias string[] surrealNumber;" or "alias surrealNumber = string[];"
Nov 20 2013
seany:is typedef gone? http://forum.dlang.org/thread/aqsjjrtzfzslcopabqgs forum.dlang.org?page=2Right.so If I want to define a new type as typedef string[] surrealNumber, then it does not work?There is a Typedef implemented in Phobos. In some cases it works, but it's still buggy (search for it in Bugzilla if you want to know). Bye, bearophile
Nov 20 2013
On Wednesday, 20 November 2013 at 10:49:19 UTC, seany wrote:is typedef gone? http://forum.dlang.org/thread/aqsjjrtzfzslcopabqgs forum.dlang.org?page=2 so If I want to define a new type as typedef string[] surrealNumber, then it does not work?typedef was removed from the language, there were reasonable arguments for the type to act as a "base" or "child" type and could not satisfy both. alias operates as the C typedef does, it just gives another symbol to refer to the same thing, generally better for complex type names than need simplified.
Nov 20 2013