Discussed in 2011: https://news.ycombinator.com/item?id=3392728
The Ugliest C Feature: tgmath.h
21–24 of 24 posts
Re: The Ugliest C Feature: tgmath.h
#22The ternary operator is indeed special as it (is the only one AFAIK that) introduces in the language some type constraints between the two result branches, that affect the way one or the other is interpreted. A similar trick in C++ is explained on https://www.artima.com/cppsource/foreach2.html and allows to return the type of an expression without evaluating it . From the link: > You may be thinking this is needlessl…
"But there already is a C++ facility whose sole purpose is determining the type of an expression [or entity] without evaluation it?"
decltype() only exists since C++11 (and the above article is from 2006).
Re: The Ugliest C Feature: tgmath.h
#23With apologies to Philip Greenspun: Any sufficiently complicated C program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of C++.
Re: The Ugliest C Feature: tgmath.h
#24With apologies to Philip Greenspun: Any sufficiently complicated C program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of C++.
Sure, but the C++ STL is to code as this [1] is to knives. [1] https://www.amazon.com/Wenger-16999-Swiss-Knife-Giant/dp/B00... .
(Are there enough knives in the entire swiss army to make this work?)