Thread overview
typedef '?
Nov 20, 2013
seany
Nov 20, 2013
evilrat
Nov 20, 2013
Dicebot
Nov 20, 2013
bearophile
Nov 20, 2013
Jesse Phillips
November 20, 2013
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?
November 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[];"
November 20, 2013
seany:

> is typedef gone?
> http://forum.dlang.org/thread/aqsjjrtzfzslcopabqgs@forum.dlang.org?page=2

Right.


> 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
November 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:
>> 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[];"

Those are not equivalent. Alias does not create new type.
November 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.