Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is <tgmath.h> implemented?

Tags:

c

overloading

C doesn't have (to the best of my knowledge) overloading or templates, right? So how can a set of type-agnostic functions with the same name exist in plain ol' C? The usual compile-time trickery would involve a whole bunch of macros, wouldn't it?

like image 508
sync Avatar asked Apr 28 '10 03:04

sync


1 Answers

There's a great explanation of how it works in GCC here.

Also, if anyone can solve the medium-difficulty exercise, I'd love to know the answer.

like image 166
rlbond Avatar answered Nov 15 '22 21:11

rlbond