Closed nemequ closed 4 years ago
Never heard of it and it is in general very GCC specific so... I don't think I'll add it as in general this library implementation in C is more reference implementation that high performance one.
It's really not GCC-specific… clang, Intel C/C++, Oracle Developer Studio, IBM XL C/C++, ARM C/C++, and various TI compilers also support it.
But I would probably #include the C anyways instead of treating it as a separate compilation unit anyways, so this doesn't really effect me.
See https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute for documentation.
It's not really just GCC, several compilers support it… it would be great you supported at least clang, too, but if you want to just use the macro from Hedley that would be best IMHO. That said, I'm the sick bastard who wrote Hedley so obviously I'm biased.