4 ms·
Any reason why they don't use trick #1 inside trick #5? // Instead of x = x ? x : 10; // We can use the shorter form: x = x ?: 10; #define min(a, b) ({ \
by n1mda 12y ago
Any reason why they don't use trick #1 inside trick #5?
// Instead of
x = x ? x : 10;
// We can use the shorter form:
x = x ?: 10;
#define min(a, b) ({ \
__typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; \
})
- stingraycharles 12y agoWouldn't that return _a < _b instead of _a?
- delinka 12y agoindeed it would.