Post #24925 20 Apr 7, 2026, 08:31 UTC The "macro overloading" idiom – Arthur O'Dwyerhttps://quuxplusone.github.io/blog/2026/04/02/macro-overloading/https://redd.it/1sep7sx@r_cpp Arthur O’Dwyer The “macro overloading” idiom Here’s a neat trick to create an “overloaded macro” in C, such that M(x) does one thing and M(x, y) does something else. For example, we could make a macro ARCTAN such that ARCTAN(v) calls atan(v) and ARCTAN(y,x) calls atan2(y,x). #define GET_ARCTAN_MACRO(_1…