3 ms·
> typeof(...) is standard I thought C++11 went with decltype because typeof was implemented by compilers as an extension with various subtle semantic differenc
by RcouF1uZ4gsC 5y ago
> typeof(...) is standard
I thought C++11 went with decltype because typeof was implemented by compilers as an extension with various subtle semantic differences than what they wanted.
I wonder why the C committee went with typeof instead of decltype?
- bonzini 5y agoIIRC typeof is implemented in the same way by all compilers that have it, but it had some subtle differences with what the committee wanted. The differences presumably do not matter for C, in fact I think it was something related to references.
- pwdisswordfish9 5y agoBecause that would then create subtle incompatibilities with C++, stemming from the fact that C has no reference types. http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2927.htm#existing-decltype http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2927.htm#ex...
- deleted 5y ago[deleted]