Why typedef's shouldn't have been removed :(

Mehrdad wfunction at hotmail.com
Mon May 7 13:42:40 PDT 2012


On Monday, 7 May 2012 at 20:25:35 UTC, Steven Schveighoffer wrote:
> On Mon, 07 May 2012 15:48:22 -0400, Mehrdad 
> <wfunction at hotmail.com> wrote:
>
> I'm looking at this:
>
> m += 5; // ok
> m = m + 5; // error
>
> And thinking, hm.. this is no good :)

Yeah, that means they were implemented poorly. :P
It should've been an error for both, because neither of them make 
sense.
I don't see why the first one couldn't have been an error though, 
so I guess I'll have to dig up old threads on why the first one 
wasn't disallowed, since I can't see why we couldn't just 
disallow it right there...


> C compatibility is not what we are after here, alias already 
> handles C compatibility.

I see, ok.


> Not being one to have used them much, I can only recollect that 
> one example.  I do remember people bitching about them quite a 
> bit, and nobody really having any good ideas on how to fix 
> them, but I don't know circa what time period to look for those 
> discussons.  One person who was an ardent supporter of 
> typedefs, and still wants *something* like them is bearophile. 
> He might be able to list some issues/find some old posts/bugs 
> that make more sense.

Ah okay thanks.

@bearophile: If you see happen this, would you mind posting 
examples? :)


More information about the Digitalmars-d mailing list