220 3070 <489b9128-09ba-48b6-a18e-965636e9a072@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Nikolay Ivchenkov <mk.ivchenkov@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: A proposal to add swap traits to the standard library
Date: Tue, 12 Mar 2013 15:22:37 -0700 (PDT)
Lines: 69
Approved: news@gmane.org
Message-ID: <489b9128-09ba-48b6-a18e-965636e9a072@isocpp.org>
References: <CA+Acj4fnCPDP2wPVts1B4Zaz6xzZ899=A=6ShTUqw_Ep5gN7pg@mail.gmail.com>
 <6c1f8dc8-faaa-4b25-aea9-5dbe95bde4d4@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1463_25037184.1363126957095"
X-Trace: ger.gmane.org 1363126958 22147 80.91.229.3 (12 Mar 2013 22:22:38 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 12 Mar 2013 22:22:38 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDJK3XNWR4LRBLWV72EQKGQEWQXHNXI@isocpp.org Tue Mar 12 23:23:03 2013
Return-path: <std-proposals+bncBDJK3XNWR4LRBLWV72EQKGQEWQXHNXI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vb0-f72.google.com ([209.85.212.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDJK3XNWR4LRBLWV72EQKGQEWQXHNXI@isocpp.org>)
	id 1UFXb3-0001Yn-8v
	for gclcip-std-proposals@m.gmane.org; Tue, 12 Mar 2013 23:23:01 +0100
Original-Received: by mail-vb0-f72.google.com with SMTP id ft2sf391039vbb.7
        for <gclcip-std-proposals@m.gmane.org>; Tue, 12 Mar 2013 15:22:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:date:from:to:message-id
         :in-reply-to:references:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=zfGq10VHQw59GtodifZFmIIx/1ZYnqjjWcVDE/XKDjM=;
        b=XceQx8Xcx8/4t4siz4kxP4gU0/js+jPDtWMR4ZCuF76wGwGh0sPE4Oiw47E6+kWoMC
         JLKHrSYyY8gYSvbgJmWwfVJkB157vt4pq0m+GNIsq7tyoOiwjcSS6p7YLP4quCUQ4Dny
         1BJi5RTCnQrxAnjuELJX97QNbj4vDg+D+pE7TsFIVIueLGT5eMRnHajRRy39a3P0V56D
         MX+Rc/avUiFjbIJiUKLwBVKyiVPVAEgW2V+C/1gjgz5OW/wNb5TnCytcH+L9w+mgrv88
         vOc08LK2scXuJsmhOhD7xAu4YVx2KHD6x2krJYleBmMxUodGf6y5P3CFPgRVCR1s3jIT
         ohlw==
X-Received: by 10.236.131.69 with SMTP id l45mr10596548yhi.10.1363126958234;
        Tue, 12 Mar 2013 15:22:38 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.131.229 with SMTP id op5ls712108qeb.23.gmail; Tue, 12 Mar
 2013 15:22:37 -0700 (PDT)
X-Received: by 10.49.6.1 with SMTP id w1mr337384qew.24.1363126957390;
        Tue, 12 Mar 2013 15:22:37 -0700 (PDT)
In-Reply-To: <6c1f8dc8-faaa-4b25-aea9-5dbe95bde4d4@isocpp.org>
X-Original-Sender: mk.ivchenkov@gmail.com
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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:3070
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/3070>

------=_Part_1463_25037184.1363126957095
Content-Type: text/plain; charset=ISO-8859-1

On Wednesday, March 13, 2013 1:55:58 AM UTC+4, Nikolay Ivchenkov wrote:
>
> I still don't see any useful applications of such is_swappable. It doesn't 
> answer whether the provided argument(s) is/are swappable, even roughly. A 
> call to the general unconstrained version of std::swap, where both 
> arguments are lvalues of the same type, will be always well-formed. If you 
> don't want to change the declaration of std::swap, you can introduce some 
> constrained surrogate for it and construct the candidate set from the 
> surrogate and versions found by ADL:
>

Sorry, I didn't consider this idea properly. Such implementation isn't 
correct, because the general std::swap can conflict with such surrogate 
(e.g. we will get value false on std::string *&). Any other surrogate, that 
would be less specialized than the general std::swap, can potentially 
conflict with a user-defined template. So, I see only one viable solution: 
the general std::swap should be constrained.

-- 

--- 
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 email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



------=_Part_1463_25037184.1363126957095
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wednesday, March 13, 2013 1:55:58 AM UTC+4, Nikolay Ivchenkov wrote:<blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-=
left: 1px #ccc solid;padding-left: 1ex;">I still don't see any useful appli=
cations of such is_swappable. It doesn't answer whether the provided argume=
nt(s) is/are swappable, even roughly. A call to the general unconstrained v=
ersion of std::swap, where both arguments are lvalues of the same type, wil=
l be always well-formed. If you don't want to change the declaration of std=
::swap, you can introduce some constrained surrogate for it and construct t=
he candidate set from the surrogate and versions found by ADL:<br></blockqu=
ote><div><br>Sorry, I didn't consider this idea properly. Such implementati=
on isn't correct, because the general std::swap can conflict with such surr=
ogate (e.g. we will get value false on std::string *&amp;). Any other surro=
gate, that would be less specialized than the general std::swap, can potent=
ially conflict with a user-defined template. So, I see only one viable solu=
tion: the general std::swap should be constrained.<br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_1463_25037184.1363126957095--

.
