220 23744 <56995AF4.3050003@wanadoo.fr> article
Path: news.gmane.org!not-for-mail
From: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Default swap/hash_value
Date: Fri, 15 Jan 2016 21:47:48 +0100
Lines: 41
Approved: news@gmane.org
Message-ID: <56995AF4.3050003@wanadoo.fr>
References: <569582E5.1040108@wanadoo.fr>
 <2ca0a385-6399-4ac3-ba0d-609628ea4ec6@isocpp.org>
 <5697EAD8.8080104@wanadoo.fr>
 <ae07821d-6fe7-4565-804d-961e87606c82@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1452890878 16948 80.91.229.3 (15 Jan 2016 20:47:58 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 15 Jan 2016 20:47:58 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDH67CONY4PBB45V4W2AKGQEPYLPJ2A@isocpp.org Fri Jan 15 21:47:48 2016
Return-path: <std-proposals+bncBDH67CONY4PBB45V4W2AKGQEPYLPJ2A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f199.google.com ([209.85.217.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDH67CONY4PBB45V4W2AKGQEPYLPJ2A@isocpp.org>)
	id 1aKBHg-0005Jz-Pt
	for gclcip-std-proposals@m.gmane.org; Fri, 15 Jan 2016 21:47:48 +0100
Original-Received: by mail-lb0-f199.google.com with SMTP id ti8sf150664444lbb.2
        for <gclcip-std-proposals@m.gmane.org>; Fri, 15 Jan 2016 12:47:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-to:content-type:content-transfer-encoding
         :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=mZdNlX5vUTZcPcZmEbpCWXdJ7FYLb7w68A+729M715E=;
        b=xe8IyS/R+jbbTgyD+2nVMjHFi7DrazprvLVfPNk4qCatnsxjtBit4HjJJCyxiXVfOo
         +Gis5dLdoSFaaQgTTePC80XWwDpO+qQwDFyi7mHYCdXLM/Uur6xFRUqJkj3DKHzrk7Ws
         90e/asFX5yW5PQM1dF4TiWQJhiERrbcClCg6FLpIpOS3pzQgZlEg1K6qbrNqP/RAcUG0
         5Q0enrM7MQ8XhNPUQTXQ1gxAhqMXt3wY2nxPfZJuoyQY3AMNbKriPslKJ9H3MqBuC3ED
         GEOlkfmg2Hqf7kA7KtjYZ29Yi4nEYR/U2vY0O2y2h6qg/04pSUphUMh9ksSvm 
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to:content-type
         :content-transfer-encoding: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=mZdNlX5vUTZcPcZmEbpCWXdJ7FYLb7w68A+729M715E=;
        b=HFWBCXPZ9iW9eWli6uIXII2Gwc/239FIUxsFDG635U6c0BWfjo424Nkrp1YomrF/ib
         c5ebU3xszHzsrSghCpE6gsEtYRhQIk0sl5Tux7uWJJEF/I66HaAUVVrRlrHiT7XO//Gx
         UaxWHTan6OykyPklisgH0uT4I2lBSFRQcEC9zBXUZZyly1yshMnm4nW/5xiiYTQaWyJ9
         TGAKyEWYC008+qPFr6SdIaEv7mJo9h6VRKAEXcKtzGc+HJv/gSY+0TVWTwb5SOxDPmWX
         fi99d9kVYkBfiWw2SE2xEaqfilJkQlZ0U6Ko04UrzB53Ds0 
X-Gm-Message-State: AG10YOSPNqMj8d+8Qg6YYk9Ltv13Ghlved3T8E90uvR+LkKxjsKevU5zunIg4J5gt/3i9A==
X-Received: by 10.28.172.194 with SMTP id v185mr69428wme.5.1452890868366;
        Fri, 15 Jan 2016 12:47:48 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.109.143 with SMTP id b15ls201758wmi.28.canary; Fri, 15 Jan
 2016 12:47:47 -0800 (PST)
X-Received: by 10.194.110.230 with SMTP id id6mr11400980wjb.67.1452890867374;
        Fri, 15 Jan 2016 12:47:47 -0800 (PST)
Original-Received: from smtp.smtpout.orange.fr (smtp05.smtpout.orange.fr. [80.12.242.127])
        by mx.google.com with ESMTPS id pd7si19936166wjb.47.2016.01.15.12.47.47
        for <std-proposals@isocpp.org>
        (version=TLS1 cipher=AES128-SHA bits=128/128);
        Fri, 15 Jan 2016 12:47:47 -0800 (PST)
Received-SPF: neutral (google.com: 80.12.242.127 is neither permitted nor denied by best guess record for domain of vicente.botet@wanadoo.fr) client-ip=80.12.242.127;
Original-Received: from new-host.home ([92.139.160.222])
	by mwinf5d28 with ME
	id 6Lnm1s00N4oBxcU03Lnnvf; Fri, 15 Jan 2016 21:47:47 +0100
X-ME-Helo: new-host.home
X-ME-Auth: dmljZW50ZS5ib3RldEB3YW5hZG9vLmZy
X-ME-Date: Fri, 15 Jan 2016 21:47:47 +0100
X-ME-IP: 92.139.160.222
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0)
 Gecko/20100101 Thunderbird/38.4.0
In-Reply-To: <ae07821d-6fe7-4565-804d-961e87606c82@isocpp.org>
X-Original-Sender: vicente.botet@wanadoo.fr
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 80.12.242.127 is neither permitted nor denied by best guess
 record for domain of vicente.botet@wanadoo.fr) smtp.mailfrom=vicente.botet@wanadoo.fr
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:23744
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/23744>

Le 14/01/2016 22:02, Tomasz a =C3=A9crit :
> I see the reasoning between making the generation of hash_value=20
> depended on the generation of the operator=3D=3D, as we must guarantee=20
> that o1 =3D=3D o2 implies that hash_value(o1) =3D=3D hash_value(o2). Howe=
ver I=20
> do not see any correlation between generation of swap and operator=3D=3D.=
=20
> If move-constructor can be generated then we will have default=20
> implementation of swap (via std::swap). I think that you should=20
> generate swap for every class that have generated move operations (no=20
> user defined: copy/move constructor, copy/move assignment and destructor)=
..
>
I believe that you are right, swap has nothing to be with =3D=3D.
> I may be beneficial to have proper rule of six: i.e. non of following=20
> copy constructor/assigment, move constructor/assignment, swap,=20
> destructor is generated if at least on of them is defined. However=20
> this would be breaking change (as we may already have classes with=20
> swap, that uses compiler generated special functions), so I would=20
> stick to making swap depended on other five.
Agreed.
>
> Also the dependency on rule of five, would also lead of question if we=20
> should support defining swap on request via =3Ddefault.
I'll consider this point. It could be sometimes useful, e.g. when the=20
defined destructor is not managing resources.

Thanks for catching this,
Vicente

--=20

---=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.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-propos=
als/.

.
