Opened 14 years ago

Last modified 9 years ago

#2628 assigned Bugs

Sequence concept incorrectly fails for basic_string

Reported by: Joel Lathrop <jal6806@…> Owned by: acharles
Milestone: Boost 1.56.0 Component: concept_check
Version: Boost 1.37.0 Severity: Problem
Keywords: concept_check Sequence basic_string Cc:

Description

The Sequence concept fails when tested against basic_string (e.g. BOOST_CONCEPT_ASSERT((Sequence<T>)); ) because an extra constructor test is included. This test is for X a(n) where n is the size of the sequence to be created. However, section 23.1.1 table 67 of the C++ standard does not include this test in the definition of the Sequence concept. Because this test is in place, basic_string is rejected by the current implementation of the Sequence concept, since basic_string does not have this constructor. However, section 21.3 paragraph 2 of the C++ standard states, "The class template basic_string conforms to the requirements of a Sequence, as specified in (23.1.1)."

The fix for this should be as simple as removing the test for a constructor of the form X a(n) in the Sequence concept implementation.

Change History (3)

comment:1 by acharles, 9 years ago

Owner: changed from jsiek to acharles
Status: newassigned

comment:3 by acharles, 9 years ago

Milestone: Boost 1.38.0Boost 1.56.0
Note: See TracTickets for help on using tickets.