4 ms·
> 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 l
by mike_hock 3y ago
> 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.
- edflsafoiewq 3y agohttps://www.open-std.org/jtc1/sc22/wg14/www/docs/n2927.htm#existing-decltype https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2927.htm#e...
- camel-cdr 3y agoIIRC behavior is has slightly different behavior, and most compilers already support typeof in c.
- hmry 3y agoBecause 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?)
- flohofwoe 3y agoApart 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).