220 33196 <00148336-0a16-4ba0-b058-1742f469328e@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Alexander Zaitsev <zamazan4ik@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: [idea for proposal] Adding std::shift to <algorithm>
Date: Wed, 12 Jul 2017 15:18:10 -0700 (PDT)
Lines: 137
Approved: news@gmane.org
Message-ID: <00148336-0a16-4ba0-b058-1742f469328e@isocpp.org>
References: <bd1a5d3b-ccc1-44ab-91cc-a4d7195c9dc3@isocpp.org>
 <a33d3e68-f629-4048-8716-418b5778d471@isocpp.org> <48819b6e-f08d-46b8-bc88-08d3640509a1@isocpp.org>
 <5666b7ac-b35e-4e9c-90ce-43a246b95f1a@isocpp.org>
 <CAJ7KwrNU1eo=CLR3D4WWywwWMLGWFzLtbHN+Qga_9GSArL0Apg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_139_2052215361.1499897890874"
X-Trace: blaine.gmane.org 1499897896 752 195.159.176.226 (12 Jul 2017 22:18:16 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 12 Jul 2017 22:18:16 +0000 (UTC)
Cc: jmckesson@gmail.com, dan@soundradix.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDGLZGV44EEBBI6ATLFQKGQE3WFOJYI@isocpp.org Thu Jul 13 00:18:11 2017
Return-path: <std-proposals+bncBDGLZGV44EEBBI6ATLFQKGQE3WFOJYI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f69.google.com ([209.85.213.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDGLZGV44EEBBI6ATLFQKGQE3WFOJYI@isocpp.org>)
	id 1dVPxP-00085N-Q0
	for gclcip-std-proposals@m.gmane.org; Thu, 13 Jul 2017 00:18:07 +0200
Original-Received: by mail-vk0-f69.google.com with SMTP id o19sf13030406vkd.7
        for <gclcip-std-proposals@m.gmane.org>; Wed, 12 Jul 2017 15:18:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=37CcC7lmmAYxvPBJTBfUD6SIKmy1cEcZhQnCr33skos=;
        b=ER4TaMpT+nKESShtqnVPmKz6Qmf6S8/xvOFn4g3/u2DKBJN4XjzHFSAlYRBhvNn4ab
         BUi7eosQCQ+ahpRPf3RDXXSJSCG4H23ThFMTaiXXOTgWWYOgzMABqWWsvN8vwf5UY+MV
         PEp9km5XpYyfLoXrKhCJxB4H8c6M0HvrsA9LlzWimdW3VocTq482v3Kx2YbNHsDT1WPo
         6u3CXzOe54Y05p+Sdr5tzzwpENwsJJavfXWoUAvGYPmHAXX4gLpVqKonlikx3AozleKF
         NbBSOlaS4gR+Lz2jdsxQMwoghxfePGc+/uy0D/FWeTjGX5GbyUeqov6C3vjdQoIppTZK
         5qGg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=37CcC7lmmAYxvPBJTBfUD6SIKmy1cEcZhQnCr33skos=;
        b=fvCFptCN9ytYeScbjSNoAQaZuMVrX2YCPFQxHImXterJpYNXPBQddrnfMc8YADgzkg
         Q8+j5WMN8gDNdNJlMv4K027+1uYD3hM6B6E3KC3B7kbBQUBITp2UDbt/fEO2W/+vyN/Z
         Xw5TAUF5L8rCMKKDfUSgTTZj0d4wRcIzRGo4cWsrql3UQSOXtjy2DTlTMcGRF0a7gOXu
         ImhRnvU4cTjyIucr+Xq9KffEsBRI48sndci02q4gMwXcea8bZBzLyT+dNvFYhaZeVTxK
         EHK6LFCUy+8yLsHFg/VK3XE6JjqSu9yz660/HmG2QvvMzQzFVgEhE4nGTFUA9F1VuOsy
         e/tw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=37CcC7lmmAYxvPBJTBfUD6SIKmy1cEcZhQnCr33skos=;
        b=DgzwlBe5DPHr23t1r8RYoifq0gJzMfqvaXv9PxrVyOfJnEKn1Pi7muWOwuzbCqtYYx
         TMmdG3ihaucHHFhsYq4lva+vcKB5JnMdPoodmeKnIMRkvjkCV2ZOGKM0cPloOX8L6exI
         i4TcXITEc87wNW7zNwTtBgUC4+G64aYo+AUJK49rVOHCF8IC3M3ax0daHwTBbfdjWJRW
         50wgZEVJKx3PyZDCV4u43vEo4wCbLaPWEHIMJUFycsV/KpJRgFcKu/wfHsUkjTMLTsDI
         dEDuFGWAbUVv4jip7KTaMMatrpSCNJiQ5hOM6u41FWKrzQQqRrq78lZInqgSTuHd6EVT
         KmcA==
X-Gm-Message-State: AIVw111cpihj5N9EQYCUvh7WAl30gBJNTB3Y83Y8s5ILg5AHTLbf16EP
	rUzsIJpyWMo24DAv
X-Received: by 10.31.72.1 with SMTP id v1mr520222vka.5.1499897892871;
        Wed, 12 Jul 2017 15:18:12 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.157.78 with SMTP id g75ls3953662ioe.17.gmail; Wed, 12 Jul
 2017 15:18:11 -0700 (PDT)
X-Received: by 10.31.174.216 with SMTP id x207mr3294vke.10.1499897891426;
        Wed, 12 Jul 2017 15:18:11 -0700 (PDT)
In-Reply-To: <CAJ7KwrNU1eo=CLR3D4WWywwWMLGWFzLtbHN+Qga_9GSArL0Apg@mail.gmail.com>
X-Original-Sender: zamazan4ik@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:33196
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33196>

------=_Part_139_2052215361.1499897890874
Content-Type: multipart/alternative; 
	boundary="----=_Part_140_955042977.1499897890874"

------=_Part_140_955042977.1499897890874
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Yes, i agree with your point of view. I meant this way - function with=20
optional fill parameter.

=D1=81=D1=80=D0=B5=D0=B4=D0=B0, 12 =D0=B8=D1=8E=D0=BB=D1=8F 2017 =D0=B3., 2=
2:11:27 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=
=D0=BB=D1=8C Dan Raviv =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>
> Indeed, circular shift is just std::rotate.
>
> For the 'logical' shift,  I was thinking leaving them in the moved-from=
=20
> state. Filling them with some value would both 1) have a cost 2) not=20
> necessarily be desired.=20
> So I'm for the same behavior as the equivalent std::move[_backward], at=
=20
> least by default.
>
> It is possible to add an optional fill-in value parameter, if that's=20
> something that would be deemed useful enough.
>
> On Wed, Jul 12, 2017 at 9:46 PM, Nicol Bolas <jmck...@gmail.com=20
> <javascript:>> wrote:
>
>> On Wednesday, July 12, 2017 at 1:17:30 PM UTC-4, Alexander Zaitsev wrote=
:
>>>
>>> Yeah, you are right :)
>>>
>>> We should create the most general implementation and efficient=20
>>> implementation for any iterator type.=20
>>>
>>> Also we should decide about type of shifting: circular and/or logical=
=20
>>> shifting ( https://en.wikipedia.org/wiki/Circular_shift ).
>>>
>>
>> Isn't circular shift just `std::rotate=20
>> <http://en.cppreference.com/w/cpp/algorithm/rotate>`?
>>
>> And how would a logical shift work? Would it value-initialize all of the=
=20
>> empty entries? Would it take a value to copy into them? Would it leave t=
hem=20
>> in the moved-from state?
>>
>
>

--=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/00148336-0a16-4ba0-b058-1742f469328e%40isocpp.or=
g.

------=_Part_140_955042977.1499897890874
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Yes, i agree with your point of view. I meant this way - f=
unction with optional fill parameter.<br><br>=D1=81=D1=80=D0=B5=D0=B4=D0=B0=
, 12 =D0=B8=D1=8E=D0=BB=D1=8F 2017 =D0=B3., 22:11:27 UTC+3 =D0=BF=D0=BE=D0=
=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Dan Raviv =D0=BD=
=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left:=
 1ex;"><div dir=3D"ltr">Indeed, circular shift is just std::rotate.<div><br=
></div><div>For the &#39;logical&#39; shift, =C2=A0I was thinking leaving t=
hem in the moved-from state. Filling them with some value would both 1) hav=
e a cost 2) not necessarily be desired.=C2=A0</div><div>So I&#39;m for the =
same behavior as the equivalent std::move[_backward], at least by default.<=
/div><div><br></div><div>It is possible to add an optional fill-in value pa=
rameter, if that&#39;s something that would be deemed useful enough.</div><=
/div><div><br><div class=3D"gmail_quote">On Wed, Jul 12, 2017 at 9:46 PM, N=
icol Bolas <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" =
gdf-obfuscated-mailto=3D"dRWtPKElBgAJ" rel=3D"nofollow" onmousedown=3D"this=
..href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;jav=
ascript:&#39;;return true;">jmck...@gmail.com</a>&gt;</span> wrote:<br><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr"><span>On Wednesday, July 12, 20=
17 at 1:17:30 PM UTC-4, Alexander Zaitsev wrote:<blockquote class=3D"gmail_=
quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;paddi=
ng-left:1ex"><div dir=3D"ltr">Yeah, you are right :)<div><br></div><div>We =
should create the most general implementation and efficient implementation =
for any iterator type.=C2=A0<br><br>Also we should decide about type of shi=
fting: circular and/or logical shifting ( <a href=3D"https://en.wikipedia.o=
rg/wiki/Circular_shift" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"t=
his.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fen.wikipedia.=
org%2Fwiki%2FCircular_shift\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGhhryP9=
byJ1Xvxy2Ow0ybk9f0MYw&#39;;return true;" onclick=3D"this.href=3D&#39;https:=
//www.google.com/url?q\x3dhttps%3A%2F%2Fen.wikipedia.org%2Fwiki%2FCircular_=
shift\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGhhryP9byJ1Xvxy2Ow0ybk9f0MYw&=
#39;;return true;">https://en.wikipedia.org/wiki/<wbr>Circular_shift</a>=C2=
=A0).<br></div></div></blockquote></span><div><br>Isn&#39;t circular shift =
just `<a href=3D"http://en.cppreference.com/w/cpp/algorithm/rotate" target=
=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.goo=
gle.com/url?q\x3dhttp%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Falgorithm%2Fr=
otate\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGYb2gKbPU9UXJskeGPZjb9ddZgcQ&=
#39;;return true;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\=
x3dhttp%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Falgorithm%2Frotate\x26sa\x3=
dD\x26sntz\x3d1\x26usg\x3dAFQjCNGYb2gKbPU9UXJskeGPZjb9ddZgcQ&#39;;return tr=
ue;">std::rotate</a>`?<br><br>And how would a logical shift work? Would it =
value-initialize all of the empty entries? Would it take a value to copy in=
to them? Would it leave them in the moved-from state?<br></div></div></bloc=
kquote></div><br></div>
</blockquote></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/00148336-0a16-4ba0-b058-1742f469328e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/00148336-0a16-4ba0-b058-1742f469328e=
%40isocpp.org</a>.<br />

------=_Part_140_955042977.1499897890874--

------=_Part_139_2052215361.1499897890874--

.
