220 35223 <otcab8$eqt$2@blaine.gmane.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Bo Persson <bop@gmb.dk>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: std::vector must have strong move guarantees.
Date: Wed, 1 Nov 2017 12:14:56 +0100
Lines: 63
Approved: news@gmane.org
Message-ID: <otcab8$eqt$2@blaine.gmane.org>
References: <0f1d296f-1d9c-4a63-bde0-bb1085b56e6c@isocpp.org>
 <f7cb7caa-f224-401a-b146-eb66a41a286a@isocpp.org>
 <1513658.MSBzcxDL38@tjmaciei-mobl1> <otc9p5$eqt$1@blaine.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1509534904 11522 195.159.176.226 (1 Nov 2017 11:15:04 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 1 Nov 2017 11:15:04 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
 Thunderbird/52.4.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCZ6RLW3UIKBBOOZ43HQKGQEAWDR5NY@isocpp.org Wed Nov 01 12:15:00 2017
Return-path: <std-proposals+bncBCZ6RLW3UIKBBOOZ43HQKGQEAWDR5NY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f69.google.com ([209.85.215.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCZ6RLW3UIKBBOOZ43HQKGQEAWDR5NY@isocpp.org>)
	id 1e9qz5-0002WV-06
	for gclcip-std-proposals@m.gmane.org; Wed, 01 Nov 2017 12:14:59 +0100
Original-Received: by mail-lf0-f69.google.com with SMTP id a16sf643028lfk.6
        for <gclcip-std-proposals@m.gmane.org>; Wed, 01 Nov 2017 04:15:06 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1509534906; cv=pass;
        d=google.com; s=arc-20160816;
        b=VKO7dzQkCg0Nn0DyFV7Ih3qPcq2MTDGsWoS392M23nEVkalU2ezQXvaUO7lz6kjMOK
         kgFSCiE0MkBwKfQ1K7e2Q9yBWwadGZ3n29gJPMRk7uI1K31guwltrqLgrEZtCAZG6bb3
         Qlmb6LDTg/WZwkU4EJHxU7y+L9DXe7DlQgeDXDLfJTh4WE2G2B+efsU4QVdJ0OBaVHuU
         PYYx6n2nBlgZ/Cxt7GY6At4iSrYbiGGdHMt9Z03Ux7c7E4izrMEipmPgXOShPQAmCXD4
         SfI/H67fsKWViG7qb5PZd+IzWeejJud0AAbGqpZ1FuneI0eyZy089OYMsuei62p+t8tg
         Ujmg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:content-language
         :in-reply-to:user-agent:content-transfer-encoding:mime-version
         :references:message-id:lines:date:subject:from:to
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=4h7SkOYw7Y7tZxQ24hocswKYmLMPGU2JGzW/5jGxXJQ=;
        b=e+8sRQhCuWv+6dY62xOdKuFl32E0wY/bIvjH4MxSb85r8fUUTDw29CIqVEKHjYx6tA
         EytwnBouoRxSkdcVdd6F/iKsftdLKBME/epopIHPu9K1cvB1ROy21R3xzLZU0YXGOFbb
         Jjm0QG9vneSlUNsuvWx3OU5aulJpdTwm3oQ2iqT7zWXxoeN4dvJSQihJIdGnyXHglmrb
         MpsacfdwnT2UWvDNbND0V1ZViX7GU6SrnOAacIdDKPE9dAkF5gAEGpGxfaY2gONut9Pw
         di8lZXXcC169lEd9hhqkMgjfArLwb0yOxCGcO61Ak5iFjU 
ARC-Authentication-Results: i=2; mx.google.com;
       spf=neutral (google.com: 195.159.176.226 is neither permitted nor denied by best guess record for domain of gclcip-std-proposals@m.gmane.org) smtp.mailfrom=gclcip-std-proposals@m.gmane.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=to:from:subject:date:lines:message-id:references:mime-version
         :content-transfer-encoding:user-agent:in-reply-to:content-language
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=4h7SkOYw7Y7tZxQ24hocswKYmLMPGU2JGzW/5jGxXJQ=;
        b=a8Dq1+z5eBUt1jghsZV7GTGzitwkM7mtiusSkg8X/BTQz1wZV259aSBzKzH46k3Fb6
         K/d2981QRma9Xk5IMHDu1vG5pCM6OnUXCMPJLuo56CfvHbsWWBzfD0XnClPaLOBkcgod
         qcokisDO00XSH+hBJH3cSxT0sJ9g9PyqSszztOlfzkQVLQvy6POyFrbe9J2MUF9pXbVO
         uf5nMYRzs7om0XSzHF2sCOYxWy8hqTvP1b7cosZC0Ic6aHIHy/G/xn89w8g7MVkAv1QG
         rz0hE4VpyCtGTZYCh8y0U4t/WqfErad+qAd7EsVZxN28a8BdXPLO/iIpfmzfphIeRS9n
       
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:content-transfer-encoding:user-agent:in-reply-to
         :content-language:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=4h7SkOYw7Y7tZxQ24hocswKYmLMPGU2JGzW/5jGxXJQ=;
        b=ckmkgxeRJJ840CQmO6Qm1lpHyfWnUHfohANUaFiD7Gq6tJgAYFw8UXNzffhjgPU6aX
         7cEOVIYXkX0RI8+5hP6kNnCVrBBOHPzoJSxi8KCAI071yeY9+dyRqr42iWyLQ5oIAWxr
         3mG5aZgKfZgIw25vxCYvnsaAcbY3hIwy4Tog7fRuGCI84r6169aQ5kymw/RmOXjK6DR+
         ld/4+5Lx4opAt8CMYc5ccxYcM7zmEfK5Di9QLEpPGsqBEV5Sa9VYPaC9C9LWFrRzIdnK
         3/owmlOLXxYW4efWF1DSkMUUjlkX4uJY6g6FG 
X-Gm-Message-State: AMCzsaXRbjfhnWWotP8bShgitKgIzi+Dv34f+EpnVQPJ5910eZu39LB1
	RFu4FuNsTUFHuCTzLi6ogl4=
X-Google-Smtp-Source: ABhQp+TdtTxgAnqF6e9/2upV4RkiXUft5ySc4ONSLcqiHJjk30D1dEAF2AesPHK6BOJtzLrUascg0Q==
X-Received: by 10.46.95.133 with SMTP id x5mr166784lje.19.1509534906723;
        Wed, 01 Nov 2017 04:15:06 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.46.25.80 with SMTP id p77ls58285lje.1.gmail; Wed, 01 Nov 2017
 04:15:05 -0700 (PDT)
X-Received: by 10.46.64.135 with SMTP id r7mr2447132lje.111.1509534905209;
        Wed, 01 Nov 2017 04:15:05 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1509534905; cv=none;
        d=google.com; s=arc-20160816;
        b=TpdZHS4nnbP3Q8YhoL6jZOTSf0xy3bGRLCol8FWB9Wb2DMm0+yMm53eQBamfobqoZ4
         TFtN5ZGIS+/ZlRKn3T4d2ewRWGzpc+4h8mmTH/MJkO16Pm7mRQGuXkM0nXN3kZRH6211
         1vI4Gk3D027eyaxVqchysbY0Za+tCtSIbDZGY7wi2UkVNt9+Y5MxJXccXQOfsUjPMt9z
         MaRQQCvrSctcQkz5OHLxqRrE7dxuywQQ/XvgQBr2/KiYfVi6x3kOtMaPGRZ00/fWuc33
         DMk/8Bm7LF49VYRh9AlyU3OtkNeMdvcVvbC28OPXX34biQSl579g6F0TdMbEpFNqTwEe
         4A9A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-language:in-reply-to:user-agent:content-transfer-encoding
         :mime-version:references:message-id:lines:date:subject:from:to
         :arc-authentication-results;
        bh=PXfJNvzQdxtJvIF57Cg84BrpKyLp+GhIO1507Ndn9b0=;
        b=T18ttkOEmElxwhJz33v9ui19b7dkS2zJs+WR6837uTdokxbdwNrEiwnV1dlPRrRXN+
         GpqiTRdIazmQkkB5Hgsy5uhmE1ie6oSic1PcEIANbF7FiE6KaFq74E2sCvDKv38ECYSM
         LJ9KOxsG9qteuGeYkYBN71X/WRkGah85HB2/YJRQLPQvLFRgLvm52/DAXF5h0SAp+XUk
         AASrKKOO2ECqeDercmLtfPzdPXhFLjv/dMJlcHV251rOzCpCSK9Q8ETTOvGrsZtr0vRk
         5Z2Ilgu57QRpWrnRclXa4kAHIn7wry1OhpU8U8mbCIUj/uGGcj4lbj+8zlo2EaAo19gs
         OQPg==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=neutral (google.com: 195.159.176.226 is neither permitted nor denied by best guess record for domain of gclcip-std-proposals@m.gmane.org) smtp.mailfrom=gclcip-std-proposals@m.gmane.org
Original-Received: from blaine.gmane.org ([195.159.176.226])
        by mx.google.com with ESMTPS id l84si179977lfi.128.2017.11.01.04.15.05
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 01 Nov 2017 04:15:05 -0700 (PDT)
Received-SPF: neutral (google.com: 195.159.176.226 is neither permitted nor denied by best guess record for domain of gclcip-std-proposals@m.gmane.org) client-ip=195.159.176.226;
Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1e9qz0-00028g-LG
	for std-proposals@isocpp.org; Wed, 01 Nov 2017 12:14:54 +0100
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 49
Original-X-Complaints-To: usenet@blaine.gmane.org
In-Reply-To: <otc9p5$eqt$1@blaine.gmane.org>
Content-Language: sv
X-Original-Sender: gclcip-std-proposals@m.gmane.org
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 195.159.176.226 is neither permitted nor denied by best guess
 record for domain of gclcip-std-proposals@m.gmane.org) smtp.mailfrom=gclcip-std-proposals@m.gmane.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:35223
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/35223>

On 2017-11-01 12:05, Bo Persson wrote:
> On 2017-10-31 17:31, Thiago Macieira wrote:
>> On ter=C3=A7a-feira, 31 de outubro de 2017 08:16:53 PDT tower120@gmail.c=
om=20
>> wrote:
>>> What if copy ctr throwable, and move constructor noexcept (for example
>>> std::vector<std::string>) ? What, in this case std::vector REQUIRED=20
>>> to use
>>> move? Or its juts too obvious for compiler that noexcept is faster path=
?
>>
>> I was hoping to find it for vector::erase(), but it says
>>
>> "Throws: Nothing unless an exception is thrown by the assignment=20
>> operator or
>> move assignment operator of T."
>>
>> So that one doesn't restrict to calling the move assignment operator.=20
>> My next
>> bet would be shrink_to_fit(), which means we reallocate but do not add o=
r
>> remove any items: I'd expect that function to be noexcept if the item=20
>> type has
>> a noexcept move constructor. However, the text has a loophole:
>>
>> " If an exception is thrown other than by the move constructor of a non-
>> CopyInsertable T there are no effects."
>>
>> It restricts to the noexceptness to non-copyable types only.
>>
>=20
> Not exactly. It's rather assumed that if the move constructor can throw,=
=20
> the implementation should prefer to copy instead. A throwing copy is=20
> recoverable ("no effects"), as the original can be preserved until=20
> everything has been copied.
>=20
> A throwing move halfway through a reallocation will get us in deep=20
> trouble. What are the odds that trying to move back some objects will=20
> not throw again? So the implementation is allowed to just abandon=20
> (destroy) the elements already moved, and so they are lost.
>=20
> We can just hope that throwing move constructors are rare. Or that we=20
> don't need to store such objects in a vector. Or, alternatively, that=20
> losing some objects is not a big deal. YMMV.
>=20
>=20

Or, reading it again, perhaps that's what you meant.  :-)


     Bo Persson


--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/otcab8%24eqt%242%40blaine.gmane.org.

.
