Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> typeof

What was wrong with "decltype"?

Seems utterly bizarre given that the rest is verbatim copypasta from C++, even the attribute syntax that sticks out like a sore thumb in C, and also given that auto and decl.. I mean, typeof, serve no useful purpose in C.




Because it has different behavior than decltype. (Isn't that why they decided to call it decltype in C++ in the first place? To show that it has different behavior than the GCC extension typeof?)


IIRC behavior is has slightly different behavior, and most compilers already support typeof in c.


Apart from having different behaviour than decltype, typeof is also a much better name IMHO (and GCC had typeof as language extension probably even before C++11 added decltype).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: