From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107756 invoked by alias); 31 May 2017 10:34:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 107732 invoked by uid 89); 31 May 2017 10:34:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=fran=e7ois, Franois, Fran=e7ois, franois?= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 31 May 2017 10:34:53 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BEA8181252; Wed, 31 May 2017 10:34:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BEA8181252 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jwakely@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BEA8181252 Received: from localhost (unknown [10.33.36.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71A96C223C; Wed, 31 May 2017 10:34:55 +0000 (UTC) Date: Wed, 31 May 2017 10:37:00 -0000 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: Default std::vector default and move constructor Message-ID: <20170531103454.GL12306@redhat.com> References: <20170525162816.GD12306@redhat.com> <20170527111401.GH12306@redhat.com> <4fcb496e-08ed-85ef-0470-e4f5b0d816ca@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4fcb496e-08ed-85ef-0470-e4f5b0d816ca@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.8.0 (2017-02-23) X-SW-Source: 2017-05/txt/msg02331.txt.bz2 On 29/05/17 22:55 +0200, François Dumont wrote: >Hi > > It wasn't such a big deal to restore value-init of the allocator. >So here is the updated patch. > > I used: > _Bvector_impl() _GLIBCXX_NOEXCEPT_IF( noexcept(_Bit_alloc_type()) ) > > rather than using is_nothrow_default_constructible. Any advantage >in one approach or the other ? Well in general the is_nothrow_default_constructible trait also tells you if the type is default-constructible at all, but the form above won't compile if it isn't default-constructible. In this specific case it doesn't matter, because that constructor won't compile anyway if the allocator isn't default-constructible. > I'll complete testing and add a test on this value-initialization >before commit if you agree. Thanks. > Tests still running but I'm pretty sure it will work the same. Yes, it should do. I'm going to commit a fix for PR80893 in vector::_M_initialize but I don't think it will conflict with your changes.