Skip to main content
Share Your Experience: Take the 2024 Developer Survey

New answers tagged

3 votes

An Attempt at Creating Generic min()/max() for Fundamental Types

Bug With Floating-Point NaN The a > b ? a : b check will fail when b is NaN and a is not, ...
Davislor's user avatar
  • 7,741
2 votes

An Attempt at Creating Generic min()/max() for Fundamental Types

Let's go crazy and make N macros and N*N functions. ...
5 votes

An Attempt at Creating Generic min()/max() for Fundamental Types

The compound expression statement would restrict the scope of x and y, but there may still be conflicts with variable names that ...
Harith's user avatar
  • 7,414
4 votes

An Attempt at Creating Generic min()/max() for Fundamental Types

UB (a) + (b) which would invoke undefined behaviour on signed integer overflow. Well sure, integer addition can overflow. But we have operations that don't, ...
J_H's user avatar
  • 28.2k

Top 50 recent answers are included