220 33193 <CADw4SdTSRXazyZUMrD_g+zS5HBLWPELDUzHjfEgZNd_AcC6_YA@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Dan Raviv <dan.raviv@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: [idea for proposal] Adding std::shift to <algorithm>
Date: Thu, 13 Jul 2017 00:14:38 +0300
Lines: 127
Approved: news@gmane.org
Message-ID: <CADw4SdTSRXazyZUMrD_g+zS5HBLWPELDUzHjfEgZNd_AcC6_YA@mail.gmail.com>
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>
 <df32b9a3-9215-4517-9bba-ba42654c55ee@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="001a1137cfe8fe0c8c0554254ee3"
X-Trace: blaine.gmane.org 1499894109 25368 195.159.176.226 (12 Jul 2017 21:15:09 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 12 Jul 2017 21:15:09 +0000 (UTC)
Cc: jmckesson@gmail.com, "dan@soundradix.com" <dan@soundradix.com>
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5YJREBWAGRBVFCTLFQKGQEMLM2I5I@isocpp.org Wed Jul 12 23:15:04 2017
Return-path: <std-proposals+bncBC5YJREBWAGRBVFCTLFQKGQEMLM2I5I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f199.google.com ([209.85.213.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC5YJREBWAGRBVFCTLFQKGQEMLM2I5I@isocpp.org>)
	id 1dVOyH-0005sr-MN
	for gclcip-std-proposals@m.gmane.org; Wed, 12 Jul 2017 23:14:57 +0200
Original-Received: by mail-yb0-f199.google.com with SMTP id j80sf28153304ybg.8
        for <gclcip-std-proposals@m.gmane.org>; Wed, 12 Jul 2017 14:15:02 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1499894101; cv=pass;
        d=google.com; s=arc-20160816;
        b=GnKJOJp2oGR2U/sgW9Gv2kbb97X8eHC30SRkLSr4DzorrehHAglMmk5GvysWzG3pKQ
         Y0F5AUZ/64spdtboJCsUrvfhUCxApzsIL54zM/IzjJSsxBlRIGMc0u1uN/v2jvKMImLZ
         063+5+oIc//chLukgF7VfRA/WaXoUQWCd2kfV0rrdM8w7RaRymen3gc5pNFg4ZnTpIPb
         z/Cl+phEnIzW26ueYNkmSGib+9CYXGh2B2JOJbRK4LWb7V+0BpTFGGVrG0gW6lpSEf3t
         ef0TrlxtXRXr9iG8/YzOpitGfLTym+ZQcP27pGnmvEwjBu37jKyz/JDnwTHFZra/P/JX
         lDbQ==
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:cc:to:subject:message-id
         :date:from:references:in-reply-to:mime-version
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=Up+Qd/kKV313kyVrmNFg8Xfb9V/kTex/tMyTq8Iit+o=;
        b=KVmC+BSIyHcuRQdZufV6TRzyRUEnEmew6ov34OzhuAepyNMB/u5oVzgEN4MvLVgFsL
         tFuHi9wpmcxeVGHran71BkedaSfm3HxUHGNNFdNO5h9WBFSYgf9+GdIGnfeX1ZZ8NC1Z
         T8ysjRgAcquSB6DeAcJmrDbowbh3+n38tLJ+elKUDcnxFHrw5l/OcKgBcdbygOxngcvx
         Kg8kqvcxn1L8pxznYc6TzkYm4bcrElK4p9P2gBBoFKp+ZqaLzK4CqJb7L2vd+hRw8TXH
         vvkXNJbrBAMpzTKm8XDXHxbT7l3t2OVVHXSdNzH+czF/q1WNbRBjH+KWqkTT9kLlZ6cD
         +2fQ==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.b=uJKASWKF;
       spf=pass (google.com: domain of dan.raviv@gmail.com designates 2607:f8b0:4003:c06::234 as permitted sender) smtp.mailfrom=dan.raviv@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=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :cc: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=Up+Qd/kKV313kyVrmNFg8Xfb9V/kTex/tMyTq8Iit+o=;
        b=pJfDc92L/NGo1uuwwu9wIRETmZaPkvL3qKAU3FmEivZPjOAUbtg7BX5B4T0KHYG4/0
         yvIzxdrVAKxeD3Yz1v3YrxrnuLMQDCsq7fU/ZP61cQIoJDKpxmNNZuMbqa2Tt1x7EsmF
         e67XhvreO/6rftTQxQzzfXjqOvJsnBMGzL4qxWkWfAf55uZVopgfdmJ3Hb4I62eXy+HN
         J7dCn/ECxQ/gl+bHtKcw5KDlAORBa4UFyQU1RZXeh6k/j2joHkvXt+/nmK7rBmzrGZXA
         uCmnfb5IbE8GM+jstv+frxhy7f9WRPL9QUR9HgJtOzeaes+TmGKdHsdTYpNEMOkrHNaO
         faOQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:cc: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=Up+Qd/kKV313kyVrmNFg8Xfb9V/kTex/tMyTq8Iit+o=;
        b=pDAfjY13OXiPLs4A/JQq+EgPW+oOC2gBimuWXgq+0F9jOB739af82gFizWsuL1hKil
         YSSwP/kqF/TsVY+Dsupy8moJf0D6jt8wNOyXgmn9u8StDwTiFk1RtPgO+bbmJfM31yyG
         BAW1Q4aTfzewdGCRiu6p6iwPGGAj3h0wYJE4HIlHY7gqsGf8X5ErHs1s61dmxbrTRKYq
         JVfBQVntVKHgh/JoWzGpjH7/bLAeH7lvGLYaIzT9LYqLqTxs1mhiyNanJkgkTPxNt6FB
         czOkp1P/CCQVFOaYPW7i5uu9d2wEP4K3KaE2f5hsIe1NYbAj/XqBBBgU9z5C6gk2UA1e
         pedQ==
X-Gm-Message-State: AIVw1134TP9gOfYUYlh3jjZhW84oWKgjE5zC5+VF4MZHBTV4LPErXHKG
	rLoszOGOurVnae1L
X-Received: by 10.129.182.10 with SMTP id u10mr431507ywh.152.1499894101622;
        Wed, 12 Jul 2017 14:15:01 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.160.210 with SMTP id j201ls4215244ioe.38.gmail; Wed, 12
 Jul 2017 14:14:59 -0700 (PDT)
X-Received: by 10.202.86.83 with SMTP id k80mr401975oib.154.1499894099904;
        Wed, 12 Jul 2017 14:14:59 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1499894099; cv=none;
        d=google.com; s=arc-20160816;
        b=qwlI1eDz7D73gxXmMXEgaQr4gPoZDc+Qb1Rj5ODCJnS6Xo8C6OHwqHrDK9hHZz278F
         nsVWES8pur/X8/1Luld2qGj9J3axJQ3Qyr+UwZwGerbpbms4gc/LtokEiK5EIBQ19HKU
         QIbfugjb8yA+ZhKemMCSTyjALDhaHlO83a6eAiXV4fe2CdF82ZRNpEwdNIGym6T7XN1L
         HzR5bbBIbd9s1YkIKOiCwUd7NYOnsTL1eJ6OCSW5YstUE5HFg/gpC3r9KIzzhpPzBGXh
         E6MXfyWf3I9bJWi4z5BEpfeBlZlpUw0ng9dq3Rc9ontHpQuLG4R/KGNCxgLeLaiTIgP4
         /8iA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=cc:to:subject:message-id:date:from:references:in-reply-to
         :mime-version:dkim-signature:arc-authentication-results;
        bh=1TgTU78XyVUm6Dwx0YukF2DfrBEHuAcD1gOT2usMjo0=;
        b=LlYM6yXNu1pHCX+mO1dFufKmOrWbbYw8VSrfPy5ayZfdIh0pgkPPghmYRRcBZqKbIY
         7+2oKRsZBvJZvPGJVfDix6UT4C6qfHjzTUANlk3Prk6YvAZa5vpIbjYNdTvjWh+TgqPt
         aVpzAYx8faq8kLDrBMiBKu4ON6TMqe+zAs0dNoxvhGFP9OXRnctPhxRdXYmOLpB3lfjG
         UMiOOkjgFPc2ijaEUGdf3br6mf9av8HEOupiPIwEtJJe5m3vqA3qCPijwlChqELYyqju
         bBMBlYWviM4wEZR8z6TaxgtiIy/WLTuQ51LiDB0xxIcRTGBfuIOrVqrtz60LoocqXyC0
         SqxQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.b=uJKASWKF;
       spf=pass (google.com: domain of dan.raviv@gmail.com designates 2607:f8b0:4003:c06::234 as permitted sender) smtp.mailfrom=dan.raviv@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com. [2607:f8b0:4003:c06::234])
        by mx.google.com with ESMTPS id 131si2530705oii.143.2017.07.12.14.14.59
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 12 Jul 2017 14:14:59 -0700 (PDT)
Received-SPF: pass (google.com: domain of dan.raviv@gmail.com designates 2607:f8b0:4003:c06::234 as permitted sender) client-ip=2607:f8b0:4003:c06::234;
Original-Received: by mail-oi0-x234.google.com with SMTP id l130so30748935oib.1
        for <std-proposals@isocpp.org>; Wed, 12 Jul 2017 14:14:59 -0700 (PDT)
X-Received: by 10.202.0.65 with SMTP id 62mr449469oia.86.1499894099345; Wed,
 12 Jul 2017 14:14:59 -0700 (PDT)
Original-Received: by 10.74.71.207 with HTTP; Wed, 12 Jul 2017 14:14:38 -0700 (PDT)
In-Reply-To: <df32b9a3-9215-4517-9bba-ba42654c55ee@isocpp.org>
X-Original-Sender: dan.raviv@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.b=uJKASWKF;       spf=pass (google.com: domain of
 dan.raviv@gmail.com designates 2607:f8b0:4003:c06::234 as permitted sender)
 smtp.mailfrom=dan.raviv@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:33193
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33193>

--001a1137cfe8fe0c8c0554254ee3
Content-Type: text/plain; charset="UTF-8"

I guess I shouldn't have consented to use the term 'logical' shift which
Alexander used, I was just mirroring his term, but I see it just resulted
in confusion.
I'm discussing a shift of elements inside a generic container. It isn't
'logical' in any numeric sense.

Implementing a logical shift (say for vector<bool>), which would handle
positive and negative numbers correctly, is out of the scope for this
proposal idea, I think.



On Wed, Jul 12, 2017 at 10:51 PM, Nicol Bolas <jmckesson@gmail.com> wrote:

> On Wednesday, July 12, 2017 at 3:11:27 PM UTC-4, Dan Raviv wrote:
>>
>> Indeed, circular shift is just std::rotate.
>>
>> For the 'logical' shift,  I was thinking leaving them in the moved-from
>> state. Filling them with some value would both 1) have a cost 2) not
>> necessarily be desired.
>>
>
> But logical bitshifts do fill in a specific, well-defined value. So if
> this is going to be separate from `move[_backward]`, then it ought to have
> the behavior a user would expect.
>
> So I'm for the same behavior as the equivalent std::move[_backward], at
>> least by default.
>>
>
>> It is possible to add an optional fill-in value parameter, if that's
>> something that would be deemed useful enough.
>>
>
> --
> 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/
> isocpp.org/d/msgid/std-proposals/df32b9a3-9215-4517-
> 9bba-ba42654c55ee%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/df32b9a3-9215-4517-9bba-ba42654c55ee%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

-- 
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/isocpp.org/d/msgid/std-proposals/CADw4SdTSRXazyZUMrD_g%2BzS5HBLWPELDUzHjfEgZNd_AcC6_YA%40mail.gmail.com.

--001a1137cfe8fe0c8c0554254ee3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I guess I shouldn&#39;t have consented to use the ter=
m &#39;logical&#39; shift which Alexander used, I was just mirroring his te=
rm, but I see it just resulted in confusion.</div><div>I&#39;m discussing a=
 shift of elements inside a generic container. It isn&#39;t &#39;logical&#3=
9; in any numeric sense.</div><div><br></div><div>Implementing a logical sh=
ift (say for vector&lt;bool&gt;), which would handle positive and negative =
numbers correctly, is out of the scope for this proposal idea, I think.</di=
v><div><br></div><div><br></div></div><div class=3D"gmail_extra"><br><div c=
lass=3D"gmail_quote">On Wed, Jul 12, 2017 at 10:51 PM, Nicol Bolas <span di=
r=3D"ltr">&lt;<a href=3D"mailto:jmckesson@gmail.com" target=3D"_blank">jmck=
esson@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v dir=3D"ltr"><span class=3D"">On Wednesday, July 12, 2017 at 3:11:27 PM UT=
C-4, Dan Raviv wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;ma=
rgin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"lt=
r">Indeed, circular shift is just std::rotate.<div><br></div><div>For the &=
#39;logical&#39; shift, =C2=A0I was thinking leaving them in the moved-from=
 state. Filling them with some value would both 1) have a cost 2) not neces=
sarily be desired.</div></div></blockquote></span><div><br>But logical bits=
hifts do fill in a specific, well-defined value. So if this is going to be =
separate from `move[_backward]`, then it ought to have the behavior a user =
would expect.<br><br></div><span class=3D""><blockquote class=3D"gmail_quot=
e" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div dir=3D"ltr"><div>So I&#39;m for the same behavior as the equi=
valent std::move[_backward], at least by default.</div></div></blockquote><=
div></div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0=
..8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><br=
></div><div>It is possible to add an optional fill-in value parameter, if t=
hat&#39;s something that would be deemed useful enough.</div></div></blockq=
uote><br></span></div><span class=3D"">

<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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/df32b9a3-9215-4517-9bba-ba42654c55ee%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/df32=
b9a3-9215-4517-<wbr>9bba-ba42654c55ee%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></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/CADw4SdTSRXazyZUMrD_g%2BzS5HBLWPELDUz=
HjfEgZNd_AcC6_YA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CADw4SdTSRXazyZ=
UMrD_g%2BzS5HBLWPELDUzHjfEgZNd_AcC6_YA%40mail.gmail.com</a>.<br />

--001a1137cfe8fe0c8c0554254ee3--

.
