libstdc++ not conforming with --enable-concepts-check?
Matt Austern
austern@apple.com
Wed Sep 22 16:18:00 GMT 2004
On Sep 22, 2004, at 8:55 AM, Nathan Myers wrote:
> On Wed, Sep 22, 2004 at 04:35:40PM +0200, Paolo Carlini wrote:
>> magfr@lysator.liu.se wrote:
>>
>>> Hello.
>>>
>>> If I try to compile the attached program and have built the compiler
>>> with
>>> --enable-concept-checks that fails but as far as I can see from the
>>> standard
>>> queue only requires that the elements should be CopyConstructible,
>>> there is
>>> no requirement for DefaultConstructability, so I think that is a bug
>>> in the
>>> concept checking code.
>>
>> Hi and thanks for your message: in my opinion, indeed, we have a bug.
>>
>> // Matt Austern's book puts DefaultConstructible here, the C++
>> // standard places it in Container
>
> Maybe std::queue shouldn't require DefaultConstructible, but isn't its
> default container std::deque, and shouldn't deque be enforcing it?
> Why is it failing to do so?
There are two different issues: does the container type have to be
default constructible (yes: it says so in table 65), and do the
container elements have to be default constructible (no; 23.1/3 gives
the requirements on container elements, and "default constructible"
isn't one of them, and implementations go to a great deal of effort to
make sure that they don't require it by accident).
If our concept checking code is requiring container elements to be
default constructible, that's just a bug. Probably a very simple one.
--Matt
More information about the Libstdc++
mailing list