Re:Function overloading in C
by maxlybbert on Sunday July 26, 2015 @06:21PM
(#9952393)
> Just because you can doesn't mean you should.
The fact that it's new doesn't mean it's in bad taste.
GCC has had a similar mechanism in C for decades. It was experience with that mechanism, and similar extensions in other compilers, that led to it being in the C Standard.
Back in C99, generic trig functions were put in to make the number-crunching people happy. After all, FORTRAN has them. Everybody was tired of different versions of math libraries for "float" and "double". Then in C11, the mechanism behind that, "_Generic", was exposed. Now, anybody can use it. But, probably, they shouldn't. [1]
[1] http://www.robertgamble.net/2012/01/c11-generic-selections.h...