Closed Bug 1030515 Opened 5 years ago Closed 5 years ago
Signed and Is Unsigned usable with user-defined types
C++11 defined std::is_signed and std::is_unsigned as (is_arithmetic && T(-1) < T(0)) or similar. But this implies that whatever T is, it has to be int-constructible in a sensible manner. Which makes it useless for signedness testing in generic code. This was apparently a defect, DR2197: http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2197 And according to that, existing implementations were already saying "no" for user-defined types, even when they wouldn't work with the C++11 definition exactly as written. So it seems to me we should fix our implementation to be consistent with the defect resolution. Patch approach mostly cribbed from the libstdc++ implementation.
Attachment #8446275 - Flags: review?(nfroyd) → review+
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.