220 33434 <8E9545B5-E594-4268-B6AB-ABEA85F085B4@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Howard Hinnant <howard.hinnant@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: [idea for proposal] Adding std::shift to <algorithm>
Date: Fri, 28 Jul 2017 17:13:30 -0400
Lines: 95
Approved: news@gmane.org
Message-ID: <8E9545B5-E594-4268-B6AB-ABEA85F085B4@gmail.com>
References: <bd1a5d3b-ccc1-44ab-91cc-a4d7195c9dc3@isocpp.org>
 <3e77c029-bc79-424c-bdad-eba28ec10cdb@isocpp.org>
 <94CDFCD7-3F9D-4D7E-BDD7-58D27561C291@gmail.com>
 <5894BCEB-596E-4B45-B47C-0D5011F51D87@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Content-Type: multipart/signed;
 boundary="Apple-Mail=_7F44FA8D-991D-4F46-A7E1-6A687C82E7B0";
 protocol="application/pgp-signature"; micalg=pgp-sha256
X-Trace: blaine.gmane.org 1501276417 19026 195.159.176.226 (28 Jul 2017 21:13:37 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 28 Jul 2017 21:13:37 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCK2HM4L6YERB7OR53FQKGQEIZUBO6I@isocpp.org Fri Jul 28 23:13:33 2017
Return-path: <std-proposals+bncBCK2HM4L6YERB7OR53FQKGQEIZUBO6I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f69.google.com ([209.85.214.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCK2HM4L6YERB7OR53FQKGQEIZUBO6I@isocpp.org>)
	id 1dbCZc-0004Wv-Up
	for gclcip-std-proposals@m.gmane.org; Fri, 28 Jul 2017 23:13:29 +0200
Original-Received: by mail-it0-f69.google.com with SMTP id 7sf210774930ita.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 28 Jul 2017 14:13:34 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1501276414; cv=pass;
        d=google.com; s=arc-20160816;
        b=Vk78LucGbSNV9QEgZUdS3nF5b2HgP7aZy8M0iZ0X4n5URMuM6BwEE7afJKcwS/MEVB
         gGB2kb6NdgE9oYt2ncX8ToVQL/8vPcDgGOe+/OU3je6xG6GfN9U4SZockDRtnApoLCWs
         xFFXlCeQzsYYBP+Yk/GS21zREbz9qUSpJpsJs1jQ03aEksyAE+R1Fi+EV+3Y894+gnmP
         L0za8GXXm+KIS8KfIrifysa+B/R34Kz1nu6SxOBYfJGtZzRqm2gwkR8tliSA4hNB4A0O
         D7iyeNw0xRdCiFoKyAMG6LkKKKzGiS8Eo+GXASNlJzqA9KUTjs0Fgmh3+Qws3rWQ+8x4
         LXXg==
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:message-id:in-reply-to:to
         :references:date:subject:mime-version:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=R+PvccLWg6WC459A9wYQmWJjWKDDMRv4aQLreYkKGEU=;
        b=OgwDha4es9vkHEy3Lz/l9vVRj0c4SYA6RPO+5aDsBgcOJeC6j6cDVuAdHaMX8QfrRy
         Cv/JKyBh5CbqyePmaubViME4Z7Fnv0CTb19gtwlhXZZW+fwrbeDLrWMFMSWiYxAj21r/
         DxsnZDABVgjWmgvUUq78pP8ZAt6b/AS28iD8It153xhd2zlJojwz0MmujyFZRdlrXi5C
         84LTIkp77ksPwjIqxKh1d4sd5dm/QPaiIYLgx3iNFDeozGindgcg4DAs/pviRfgAAzpk
         QeppMdXeDPKZRaQIeZgagW0NaA+16gV6PSlZcKVAQ+eO2srRGsTch//0dUUbf48K3mmv
         MaVg==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.b=oXOh3KYN;
       spf=pass (google.com: domain of howard.hinnant@gmail.com designates 2607:f8b0:4001:c0b::243 as permitted sender) smtp.mailfrom=howard.hinnant@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:mime-version:subject:date:references:to:in-reply-to:message-id
         :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=R+PvccLWg6WC459A9wYQmWJjWKDDMRv4aQLreYkKGEU=;
        b=RNfgzx38M3qOpUG5KCcrp6/Yf4d3k1ISwOFOs+BWCK89I0X4JWgINCw4wpOLcMmKPg
         HuocG/YQqCyLnDa1+yD4HEJuZW6r/AfLMvTuno+A2nuJCRpqw/+xbWt//QYKRMfS2D4e
         87YPUV8q7EyRCIT9CJB1lgx4CCb3Prh2/n/mmx3Aj2BSiF/YaJJi5wjRq0OclZ5bbrTI
         rcss5tCknOr37VEgyzF2AKK3DaXPqwKTBOSiVlGF1knfUTXZx+RVj7AUoI3+vVaBhma4
         UnUQ7oIiA+O2wNUWRAvno+1i1Q6cl6uMiDofLTIV4vcb2e7oFcxBoFzGqcO9jOx2ndEJ
         1kbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:mime-version:subject:date:references:to
         :in-reply-to:message-id: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=R+PvccLWg6WC459A9wYQmWJjWKDDMRv4aQLreYkKGEU=;
        b=Q9XJC3P4ZBihL8VxBRY9s5ruCmY2ADnUizzibLmcTbfq05VR5MOJuxPwsmKDrt61mP
         iX6feFzPh7xbjmdE3YjuJ2vxIabZQLxkfLpOAPLwwDbfY/xlWt90gmI/1r/UrJNU4Mji
         DWk2wRjA52mv7qCJDi0A7X9dgWVQCCX5Py22p2FZiDmlV+Jbz7AWqcrsaLTESjb4u8Sm
         8i6c9+VboqMGpaeutBZRwZGnRoU2LOlioekbLkwNrWsIToXktw5DwWAfhiYa98p2qxcW
         Hx3OWYp44mrmXnR5DS+PqeGVRiKdNEs0eIwlLy6gBc12M57T5FyFqjHD9sRB+wqLBAdU
         KCkw==
X-Gm-Message-State: AIVw110Y8b1uEOSn2YL2EWfSllxWB+gvfSHMhqRtLvcJvGLNQNgnFlRY
	KBtiVyBN02KfW0Gd
X-Received: by 10.36.20.207 with SMTP id 198mr5493868itg.42.1501276414346;
        Fri, 28 Jul 2017 14:13:34 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.26.68 with SMTP id 65ls4998238iti.14.canary-gmail; Fri, 28
 Jul 2017 14:13:32 -0700 (PDT)
X-Received: by 10.107.180.65 with SMTP id d62mr11729996iof.291.1501276412957;
        Fri, 28 Jul 2017 14:13:32 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1501276412; cv=none;
        d=google.com; s=arc-20160816;
        b=ed/1thLb+GrADkxDlSHOkslfHLLT0XG3NbwFTbqlUHzvhHtGgnd2ko37ByFK2A0nW8
         8repbpUVJ7tUlrY8/eZxRQVwKUD5Rujy3kcXtImb2nWABJ5bTXSBGop/HMajl62856ON
         3EfxfdSgliE4OU1djJUVg8ZaeSLiGpFh2NEkUWxQYFeb7WxXJ6VpoB/sdIwwG6/saQnX
         I2i5yjqYfBVEMVnvZ8ZKr3OpW6CeBVNlKP8DASAL6jyrrZSFp3QJbhmO/PFLE8NIJoyh
         yo8ZriPd52ObRNdM5Y1Xv44mF5EBnTvxDy9AbEC5X0fl867Ef+E1PpVHNlbVTHnl3L/N
         DrHw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=message-id:in-reply-to:to:references:date:subject:mime-version:from
         :dkim-signature:arc-authentication-results;
        bh=QZKL7dSTaAxs1gHjPIg3ICHiMRSDw0oUYLXtLyYA4zI=;
        b=QGz7Yt+RINO8ve67wBoWWSwdgTocXMU6UAHdREd1B/XRueifMhSpPDn0vJ4iQ5cqPP
         LORFg+oeBQsNV7zu8smDw1cuBitEwf4XKo7tQttzzV1A3VcHbhKn67mWxYDJWoob7Rh/
         W1BPQh0NeAGlul0Ooa3bEiFuaeB1/yV/0V92RX3qP5B84oyUE1jqRZ+NQzrTiayo0/pT
         wAE2akpiSXWRJdNi1yl3WR7Fnvh/OAiYq1M62uKYiHgiarEkOZHWVsMWhpJEwVN/ZtBf
         sxlhQbd7lmzFFoQQwanI5nm5bQOZWaaLU9xSp1Cob+67F2QZ1NLIRANBw5JL1giBLBU4
         Y1SQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.b=oXOh3KYN;
       spf=pass (google.com: domain of howard.hinnant@gmail.com designates 2607:f8b0:4001:c0b::243 as permitted sender) smtp.mailfrom=howard.hinnant@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-it0-x243.google.com (mail-it0-x243.google.com. [2607:f8b0:4001:c0b::243])
        by mx.google.com with ESMTPS id i9si3147621ioi.249.2017.07.28.14.13.32
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 28 Jul 2017 14:13:32 -0700 (PDT)
Received-SPF: pass (google.com: domain of howard.hinnant@gmail.com designates 2607:f8b0:4001:c0b::243 as permitted sender) client-ip=2607:f8b0:4001:c0b::243;
Original-Received: by mail-it0-x243.google.com with SMTP id t6so16234601itb.0
        for <std-proposals@isocpp.org>; Fri, 28 Jul 2017 14:13:32 -0700 (PDT)
X-Received: by 10.36.60.204 with SMTP id m195mr10257409ita.3.1501276412553;
        Fri, 28 Jul 2017 14:13:32 -0700 (PDT)
Original-Received: from [10.0.1.2] (cpe-67-241-68-255.twcny.res.rr.com. [67.241.68.255])
        by smtp.gmail.com with ESMTPSA id 201sm10687568iof.21.2017.07.28.14.13.31
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 28 Jul 2017 14:13:31 -0700 (PDT)
In-Reply-To: <5894BCEB-596E-4B45-B47C-0D5011F51D87@gmail.com>
X-Mailer: Apple Mail (2.3273)
X-Original-Sender: howard.hinnant@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.b=oXOh3KYN;       spf=pass (google.com: domain of
 howard.hinnant@gmail.com designates 2607:f8b0:4001:c0b::243 as permitted
 sender) smtp.mailfrom=howard.hinnant@gmail.com;       dmarc=pass (p=NONE
 sp=NONE dis=NONE) header.from=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: <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:33434
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33434>


--Apple-Mail=_7F44FA8D-991D-4F46-A7E1-6A687C82E7B0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

No one is claiming that <algorithm> is a complete set of all useful functio=
ns.  But no, I don=E2=80=99t see a need for rotate_right.  I find std::rota=
te easier to visualize when I call it swap_unequal_ranges.

Howard

On Jul 28, 2017, at 4:50 PM, Dan Raviv <dan.raviv@gmail.com> wrote:
>=20
> I see.
>=20
> Then, isn't there a need for, e.g., an std::rotate_right function to augm=
ent the existing rotate(_left) algorithm, since rotating right can only be =
achieved through using reverse iterators? Or is the existing std::rotate de=
signed so it can optimize for reverse iterators as well?
>=20
> Thanks,
> Dan
>=20
>> On 28 Jul 2017, at 22:19, Howard Hinnant <howard.hinnant@gmail.com> wrot=
e:
>>=20
>>> On Jul 28, 2017, at 2:43 PM, Dan Raviv <dan.raviv@gmail.com> wrote:
>>>=20
>>> Does anyone know if there was a specific motivation for adding std::mov=
e_backward() to <algorithm>? It seems that using std::move() with rbegin(),=
rend() iterators (for the basic use case) would have the same effect.
>>=20
>> See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1771.html
>>=20
>> Section 25 - Algorithms library
>>=20
>> Howard
>>=20
>> --
>> You received this message because you are subscribed to the Google Group=
s "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n email 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/iso=
cpp.org/d/msgid/std-proposals/94CDFCD7-3F9D-4D7E-BDD7-58D27561C291%40gmail.=
com.
>=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=
 email 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/isoc=
pp.org/d/msgid/std-proposals/5894BCEB-596E-4B45-B47C-0D5011F51D87%40gmail.c=
om.

--=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/8E9545B5-E594-4268-B6AB-ABEA85F085B4%40gmail.com=
..

--Apple-Mail=_7F44FA8D-991D-4F46-A7E1-6A687C82E7B0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCAAGBQJZe6j6AAoJEGbcHCxKqhWC3WIP/048v50CBs/lcfZZ14IgXcUv
vzVO/SDO/WcUyOBrwsYGXq5//eM+Se5BUwiTM9oV7d/bY47vLpeAzX0PScdbepBH
ZPbbJd8GR3uBVqFebfZvkOx+Pxfa47XTzrVDNaOeOEmgZFoiJjb2J1ntW8wZ7c8x
51YnDDJ+oefrQ2Yvx0gnbX9xdm1D+Y6yO/LdSM3cOnSiio2T5AO1V9xe7z2XbRx1
ANBjTBys9hSaeJysaRaSB9vMiBWxto2ffVgaxFE6xl1z5xWerEESoSgYA6D6pTR6
OMZGQPop0dQeCkD7SFzGDEhHw/8x/HbwIxg6VBMaGZ0i9cBPrFlXKGXQ5if2zFiu
lMimacjEGOwX9NVkD1I/Bo0hHDbgWZIxf1M0zRsgAewxKaEP7X6DWWrZKU67K15p
1cQbxD7m85dOqzrTEkdwfGWAF3y3FDCVV+FTsX46+lIc8qKd5Ci72ods6NhuRM7V
/iWFwed254B/phBpOrTegr3pqPGI6Kelf2QwhywJJQhZ0a+JenhwhwZKHcM5XIBw
Ds2jXMzhR1kw1Yliv8nnHVd9/fisZuE7VdUDAYO+jwYj3sbLg7XMK1mND1MVa9wv
7F7AhucOJ/af8miYXlRH0oyCsPK7ZHzTgG1hSUZkSchBQuvwM9NyBoCtqjaiWpwn
XK5zq6e0HCQCTcAdmqxX
=AijL
-----END PGP SIGNATURE-----

--Apple-Mail=_7F44FA8D-991D-4F46-A7E1-6A687C82E7B0--

.
