220 2720 <510F45EA.1080308@gmail.com> article
Path: news.gmane.org!not-for-mail
From: =?ISO-8859-1?Q?Mikael_Kilpel=E4inen?=
 <mikael.kilpelainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: A proposal to add swap traits to the standard library
Date: Mon, 04 Feb 2013 06:23:54 +0100
Lines: 41
Approved: news@gmane.org
Message-ID: <510F45EA.1080308@gmail.com>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1359955446 32168 80.91.229.3 (4 Feb 2013 05:24:06 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 4 Feb 2013 05:24:06 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDHYRTPW4EBRB44LXWEAKGQE2B73NMQ@isocpp.org Mon Feb 04 06:24:27 2013
Return-path: <std-proposals+bncBDHYRTPW4EBRB44LXWEAKGQE2B73NMQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f199.google.com ([209.85.212.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDHYRTPW4EBRB44LXWEAKGQE2B73NMQ@isocpp.org>)
	id 1U2EXX-00032f-8V
	for gclcip-std-proposals@m.gmane.org; Mon, 04 Feb 2013 06:24:23 +0100
Original-Received: by mail-wi0-f199.google.com with SMTP id hq4sf2969404wib.2
        for <gclcip-std-proposals@m.gmane.org>; Sun, 03 Feb 2013 21:24:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:x-received:received-spf
         :x-received:message-id:date:from:user-agent:mime-version:to:subject
         :references:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type
         :content-transfer-encoding;
        bh=9wajLw/5wP1fEhOHhGH/+91kELpzy0kPJMf03Vp8nFI=;
        b=dKvbvsI8IUjd+RP54BqCeCbbeI1Esyj3K9+yHF2u7G23/8fdyTiTb6RkF4xImuqniX
         TGv2d5X63ZZ81Q0Shp2rh4UIXee88Ba6v37RGDtZsa1Rxw5WOR0XyUzVKfwJYngslji5
         vEkZpMBnfU2DltUxxcHa57trwoXjgHpkT+FP4pDXzSOYWM01YDigkXmtxJbkiqYDhngX
         EKaWjD2xoVIUob/7CS1MOwt972wnA1hrvyxPG5G9vZzHBE29l/J+WhDprh8xkD3zl4w+
         NQ 
X-Received: by 10.180.19.132 with SMTP id f4mr1344182wie.2.1359955444516;
        Sun, 03 Feb 2013 21:24:04 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.101.165 with SMTP id fh5ls593819wib.13.gmail; Sun, 03 Feb
 2013 21:24:02 -0800 (PST)
X-Received: by 10.14.198.198 with SMTP id v46mr67885388een.4.1359955441959;
        Sun, 03 Feb 2013 21:24:01 -0800 (PST)
X-Received: by 10.14.198.198 with SMTP id v46mr67885377een.4.1359955441841;
        Sun, 03 Feb 2013 21:24:01 -0800 (PST)
Original-Received: from mail-ea0-f175.google.com (mail-ea0-f175.google.com [209.85.215.175])
        by mx.google.com with ESMTPS id g7si26175397eeo.128.2013.02.03.21.24.01
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 03 Feb 2013 21:24:01 -0800 (PST)
Received-SPF: pass (google.com: domain of mikael.kilpelainen@gmail.com designates 209.85.215.175 as permitted sender) client-ip=209.85.215.175;
Original-Received: by mail-ea0-f175.google.com with SMTP id d1so2590127eab.34
        for <std-proposals@isocpp.org>; Sun, 03 Feb 2013 21:24:01 -0800 (PST)
X-Received: by 10.14.221.9 with SMTP id q9mr68279393eep.3.1359955441221;
        Sun, 03 Feb 2013 21:24:01 -0800 (PST)
Original-Received: from [10.10.10.213] (static-87-79-94-26.netcologne.de. [87.79.94.26])
        by mx.google.com with ESMTPS id k7sm22697459een.8.2013.02.03.21.24.00
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 03 Feb 2013 21:24:00 -0800 (PST)
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
In-Reply-To: <510EC81E.6050803@gmail.com>
X-Original-Sender: mikael.kilpelainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of mikael.kilpelainen@gmail.com designates 209.85.215.175 as permitted
 sender) smtp.mail=mikael.kilpelainen@gmail.com;       dkim=pass header.i=@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:2720
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2720>

3.2.2013 21:27, Mikael Kilpel=E4inen kirjoitti:
>
> template<typename T>
> void foo(T&, T&) noexcept(noexcept( std::tuple<T>().swap(=20
> std::declval<std::tuple<T>&>() )));
>
>
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.

So lets summarise most of the thread :

- Problem exists with free functions and lookup if wanted to use in=20
noexcept, trailing return
- 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.
- 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.

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?


Mikael

--=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.



.
