Opened 14 years ago

Closed 12 years ago

#2629 closed Bugs (fixed)

The Integer concept fails for char

Reported by: Joel Lathrop <jal6806@…> Owned by: jsiek
Milestone: Boost 1.38.0 Component: concept_check
Version: Boost 1.37.0 Severity: Problem
Keywords: concept_check Integer concept char Cc:

Description

The Integer concept fails for char (e.g. BOOST_CONCEPT_ASSERT((Integer<char>)) results in a compiler error). However, Section 3.9.1 paragraph 7 of the C++ standard states, "Types bool, char, wchar_t, and the signed and unsigned integer types are collectively called integral types. A synonym for integral type is integer type." So while char is not a signed integer type nor is it an unsigned integer type (and therefore is rightly rejected by the SignedInteger and UnsignedInteger concepts), it is an integer type and should be accepted by the Integer concept.

This bug can be easily fixed by adding an instantiation for char to the Integer template in concept_check.hpp.

Change History (1)

comment:1 by Jeremiah Willcock, 12 years ago

Resolution: fixed
Status: newclosed

(In [62612]) Added char as an integral type; fixes #2629

Note: See TracTickets for help on using tickets.