From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1077 invoked by alias); 25 Feb 2013 06:32:08 -0000 Received: (qmail 760 invoked by uid 48); 25 Feb 2013 06:31:44 -0000 From: "tneumann at pi3 dot informatik.uni-mannheim.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/56437] basic_string assumes that allocators are default-constructible Date: Mon, 25 Feb 2013 06:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tneumann at pi3 dot informatik.uni-mannheim.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg02332.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56437 --- Comment #3 from Thomas Neumann 2013-02-25 06:31:43 UTC --- (In reply to comment #1) > This is hardly the only C++11 allocator requirement missing from std::string, > ALL of the new requirements are missing, and unlikely to be implemented until > we switch to a non-COW string implementation. Well, but this would be an allocator requirement that is easy to fix. There are only three places with "_Alloc()" in basic_string.tcc, and only two would have to be fixed as far as I can see it. I am not sure yet why the code even tries to construct the allocator, but if necessary we could use is_default_constructible to figure out of the constructor is available. I could try to produce a patch myself if you prefer. But as of new basic_string is quite unusable with stateful allocators.