Tag: 方法重载

为msvc或替代解决方法模拟__typeof__的最佳方法是什么?

我有一些代码 #define DEBUG_PRINT(x,…) \ do \ {\ _Pragma(“GCC diagnostic push”) \ _Pragma(“GCC diagnostic ignored \”-Wunused-value\””) \ __typeof__((0,x)) _x = x; \ _Pragma(“GCC diagnostic pop”) \ DEBUG_PRINT_PTR((#x), &_x, __VA_ARGS__);\ } while(0) //The repetition of debug_print_printf_specifier is to avoid repetition for custom types. #define DEBUG_PRINT_PTR(xstr, xp,…) \ _Generic((*xp), \ const char *: debug_print_printf_specifier(xstr, (void *)xp, TYPE_PTR_TO_PRINTF_SPECIFIER(xp), __FILE__, […]