220 2750 <e633003b-d8ee-4385-82bd-3b61e7d9b76a@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: =?UTF-8?Q?Andrzej_Krzemie=C5=84ski?= <akrzemi1@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: A proposal to add swap traits to the standard library
Date: Wed, 6 Feb 2013 02:34:34 -0800 (PST)
Lines: 116
Approved: news@gmane.org
Message-ID: <e633003b-d8ee-4385-82bd-3b61e7d9b76a@isocpp.org>
References: <CA+Acj4fnCPDP2wPVts1B4Zaz6xzZ899=A=6ShTUqw_Ep5gN7pg@mail.gmail.com> <1359827596.1381.2.camel@Nokia-N900> <41C25E3D-C254-43AE-BFEA-ED83B7DAF74E@gmail.com> <CANh-dXkVgtEtkUvzCkS9Gia_Rk_iesULRcH3oC-OyqX-Z7pPNA@mail.gmail.com> <510E1906.3030604@wanadoo.fr> <91576F12-5D5E-45A5-AFC1-E5A4D80052C8@gmail.com> <510EC81E.6050803@gmail.com>
 <510F45EA.1080308@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_401_4838259.1360146874472"
X-Trace: ger.gmane.org 1360146879 25385 80.91.229.3 (6 Feb 2013 10:34:39 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 6 Feb 2013 10:34:39 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDT2DGOJ34DBBO7DZCEAKGQEWCBNBYA@isocpp.org Wed Feb 06 11:35:01 2013
Return-path: <std-proposals+bncBDT2DGOJ34DBBO7DZCEAKGQEWCBNBYA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-gg0-f198.google.com ([209.85.161.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDT2DGOJ34DBBO7DZCEAKGQEWCBNBYA@isocpp.org>)
	id 1U32L8-00067K-NU
	for gclcip-std-proposals@m.gmane.org; Wed, 06 Feb 2013 11:34:55 +0100
Original-Received: by mail-gg0-f198.google.com with SMTP id a5sf654706ggn.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 06 Feb 2013 02:34:35 -0800 (PST)
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=0uejWijRwtcK2ArHMO8PSjPMCtji1lpZbNygLwfPdHU=;
        b=nn0cTBczr/mzqxArgphoTrDTzXATkYsxi53wqU7FaP/CFuyUDgLr0s82baMMeIHFky
         7SpuLCcLuTS454r2OH7r97pNn5OQEqYZgYcVno+MImhOS4oc/oLpaKHAXu6bETf3er/j
         MT8ZZijAmANBR926qwrMIOfiIzLW12KlghckHtoTfUC0jOANlIz0YXWXBfXnKry9sEY/
         7UuCc9OJGn9cGkmgOstYgQFiKhQ2Gc8uaQ8v6ba7r2QkSGt0G6081IBwjalYbYB1/bch
         fyZqMwNoXRlFTcX6qWDCC7cqitvZA3J6lqDUjn0pe76h1z787rDRjoha77n/xCrYVX+q
         t6CA==
X-Received: by 10.236.126.194 with SMTP id b42mr13147262yhi.23.1360146875349;
        Wed, 06 Feb 2013 02:34:35 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.37.134 with SMTP id y6ls284296qej.96.gmail; Wed, 06 Feb
 2013 02:34:34 -0800 (PST)
X-Received: by 10.49.96.196 with SMTP id du4mr2442965qeb.37.1360146874799;
        Wed, 06 Feb 2013 02:34:34 -0800 (PST)
In-Reply-To: <510F45EA.1080308@gmail.com>
X-Original-Sender: akrzemi1@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:2750
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2750>

------=_Part_401_4838259.1360146874472
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



W dniu poniedzia=C5=82ek, 4 lutego 2013 06:23:54 UTC+1 u=C5=BCytkownik Mika=
el=20
Kilpel=C3=A4inen napisa=C5=82:
>
> 3.2.2013 21:27, Mikael Kilpel=C3=AF=C2=BF=C2=BDinen kirjoitti:=20
> >=20
> > template<typename T>=20
> > void foo(T&, T&) noexcept(noexcept( std::tuple<T>().swap(=20
> > std::declval<std::tuple<T>&>() )));=20
> >=20
> >=20
> Seems i was already sleeping when i wrote that, as obviously this=20
> imposes some restrictions for T but maybe the concept works as a dirty=20
> workaround.=20
>
> So lets summarise most of the thread :=20
>
> - Problem exists with free functions and lookup if wanted to use in=20
> noexcept, trailing return=20
> - Having is_swappable traits (as proposed) fixes it for one of the most=
=20
> common cases, and i do agree it feels like those type traits are missing.=
=20
> - We might be able to fix this for most std free functions by making=20
> them first to perform ADL like pointed out by Yasskin. I wonder how many=
=20
> swap relies on calling the std::swap directly though and possibly=20
> recursing then.=20
>
> The problem itself it generic, but is it worth "fixing"? Is there much=20
> similar usage with other than std library that would benefit from it?=20
>

If the problem is primarily about std::swap, and swap is so very special,=
=20
perhaps defining or aliasing it in the global namespace would solve the=20
problem?=20

--=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 http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/?hl=3Den.



------=_Part_401_4838259.1360146874472
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>W dniu poniedzia=C5=82ek, 4 lutego 2013 06:23:54 UTC+1 u=C5=BCytkow=
nik Mikael Kilpel=C3=A4inen napisa=C5=82:<blockquote class=3D"gmail_quote" =
style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-l=
eft: 1ex;">3.2.2013 21:27, Mikael Kilpel=C3=AF=C2=BF=C2=BDinen kirjoitti:
<br>&gt;
<br>&gt; template&lt;typename T&gt;
<br>&gt; void foo(T&amp;, T&amp;) noexcept(noexcept( std::tuple&lt;T&gt;().=
swap(=20
<br>&gt; std::declval&lt;std::tuple&lt;T&gt;&amp;&gt;() )));
<br>&gt;
<br>&gt;
<br>Seems i was already sleeping when i wrote that, as obviously this=20
<br>imposes some restrictions for T but maybe the concept works as a dirty=
=20
<br>workaround.
<br>
<br>So lets summarise most of the thread :
<br>
<br>- Problem exists with free functions and lookup if wanted to use in=20
<br>noexcept, trailing return
<br>- Having is_swappable traits (as proposed) fixes it for one of the most=
=20
<br>common cases, and i do agree it feels like those type traits are missin=
g.
<br>- We might be able to fix this for most std free functions by making=20
<br>them first to perform ADL like pointed out by Yasskin. I wonder how man=
y=20
<br>swap relies on calling the std::swap directly though and possibly=20
<br>recursing then.
<br>
<br>The problem itself it generic, but is it worth "fixing"? Is there much=
=20
<br>similar usage with other than std library that would benefit from it?
<br></blockquote><div><br>If the problem is primarily about std::swap, and =
swap is so very special, perhaps defining or aliasing it in the global name=
space would solve the problem? <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_401_4838259.1360146874472--

.
