Topic: std::copy_backward_n, std::move_n, std::move_backward_n
Author: "'Vlad from Moscow' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 11 Jun 2018 03:26:39 -0700 (PDT)
Raw View
------=_Part_99137_1622845109.1528712799632
Content-Type: multipart/alternative;
boundary="----=_Part_99138_221332767.1528712799632"
------=_Part_99138_221332767.1528712799632
Content-Type: text/plain; charset="UTF-8"
It looks strange that there is the standard algorithm std::copy_n and there
is no standard algorithm std::move_n.
It would be logical consistent to include such algorithms as
std::copy_backward_n, std::move_n, std::move_backward_n.
--
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/4fab6961-5013-405f-9697-c447a9009bb7%40isocpp.org.
------=_Part_99138_221332767.1528712799632
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">It looks strange that there is the standard algorithm std:=
:copy_n and there is no standard algorithm std::move_n.<div><br></div><div>=
It would be logical consistent to include such algorithms as std::copy_back=
ward_n, std::move_n, std::move_backward_n.</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/4fab6961-5013-405f-9697-c447a9009bb7%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4fab6961-5013-405f-9697-c447a9009bb7=
%40isocpp.org</a>.<br />
------=_Part_99138_221332767.1528712799632--
------=_Part_99137_1622845109.1528712799632--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon, 11 Jun 2018 13:32:46 +0300
Raw View
On 11 June 2018 at 13:26, 'Vlad from Moscow' via ISO C++ Standard -
Future Proposals <std-proposals@isocpp.org> wrote:
> It looks strange that there is the standard algorithm std::copy_n and there
> is no standard algorithm std::move_n.
>
> It would be logical consistent to include such algorithms as
> std::copy_backward_n, std::move_n, std::move_backward_n.
Such proliferation of separate algorithms will happily be unnecessary
once Ranges land, and we can provide range-versions
of the full-range algorithms and slap an N-view on the source range.
--
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/CAFk2RUbY3UQYdzdn3GFe-MDqTebSUVOkbeqcLD462Cg9Mcetdg%40mail.gmail.com.
.
Author: Ryan Nicholl <r.p.nicholl@gmail.com>
Date: Tue, 26 Jun 2018 10:22:09 -0700 (PDT)
Raw View
------=_Part_43715_1080484247.1530033729273
Content-Type: text/plain; charset="UTF-8"
Disagree. ```std::move_n``` should be added for consistency. C++ is multi-paradigm and not everyone will use ranges.
--
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/ab347eb7-27d8-4a1d-92d6-2be25eabf02f%40isocpp.org.
------=_Part_43715_1080484247.1530033729273--
.
Author: Vishal Oza <vickoza@gmail.com>
Date: Tue, 26 Jun 2018 10:44:49 -0700 (PDT)
Raw View
------=_Part_43827_2128322474.1530035089888
Content-Type: multipart/alternative;
boundary="----=_Part_43828_60093783.1530035089888"
------=_Part_43828_60093783.1530035089888
Content-Type: text/plain; charset="UTF-8"
I think ranges will also fixed the issue such the algorithms such as
copy_n, copy_backward, copy_backward_n, move_n, move_backward, and
move_backward_n are not needed however I think that in ranges
algorithms move should either be rename or std::move such be destructive.
On Monday, June 11, 2018 at 5:32:49 AM UTC-5, Ville Voutilainen wrote:
>
> On 11 June 2018 at 13:26, 'Vlad from Moscow' via ISO C++ Standard -
> Future Proposals <std-pr...@isocpp.org <javascript:>> wrote:
> > It looks strange that there is the standard algorithm std::copy_n and
> there
> > is no standard algorithm std::move_n.
> >
> > It would be logical consistent to include such algorithms as
> > std::copy_backward_n, std::move_n, std::move_backward_n.
>
> Such proliferation of separate algorithms will happily be unnecessary
> once Ranges land, and we can provide range-versions
> of the full-range algorithms and slap an N-view on the source range.
>
--
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/a3b21bce-1db9-40eb-a82b-505fcd3643ec%40isocpp.org.
------=_Part_43828_60093783.1530035089888
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I think ranges will also fixed the issue such the algorith=
ms such as copy_n, copy_backward, copy_backward_n,=C2=A0 move_n, move_backw=
ard, and move_backward_n are not needed however I think that in ranges algo=
rithms=C2=A0move should either be rename or std::move such be destructive.<=
br><br>On Monday, June 11, 2018 at 5:32:49 AM UTC-5, Ville Voutilainen wrot=
e:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;b=
order-left: 1px #ccc solid;padding-left: 1ex;">On 11 June 2018 at 13:26, &#=
39;Vlad from Moscow' via ISO C++ Standard -
<br>Future Proposals <<a href=3D"javascript:" target=3D"_blank" gdf-obfu=
scated-mailto=3D"LlkhGz4NBgAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D=
'javascript:';return true;" onclick=3D"this.href=3D'javascript:=
';return true;">std-pr...@isocpp.org</a>> wrote:
<br>> It looks strange that there is the standard algorithm std::copy_n =
and there
<br>> is no standard algorithm std::move_n.
<br>>
<br>> It would be logical consistent to include such algorithms as
<br>> std::copy_backward_n, std::move_n, std::move_backward_n.
<br>
<br>Such proliferation of separate algorithms will happily be unnecessary
<br>once Ranges land, and we can provide range-versions
<br>of the full-range algorithms and slap an N-view on the source range.
<br></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/a3b21bce-1db9-40eb-a82b-505fcd3643ec%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a3b21bce-1db9-40eb-a82b-505fcd3643ec=
%40isocpp.org</a>.<br />
------=_Part_43828_60093783.1530035089888--
------=_Part_43827_2128322474.1530035089888--
.
Author: Richard Hodges <hodges.r@gmail.com>
Date: Tue, 26 Jun 2018 19:49:17 +0200
Raw View
--000000000000a1b509056f8f1e51
Content-Type: text/plain; charset="UTF-8"
On Tue, 26 Jun 2018 at 19:22, Ryan Nicholl <r.p.nicholl@gmail.com> wrote:
> Disagree. ```std::move_n``` should be added for consistency. C++ is
> multi-paradigm and not everyone will use ranges.
>
I was about to agree with you, thinking that this would be useful for
deserialising non-copyable objects from a stream. But then I realised that
std::istream_operator<T>::operator*() returns a const ref, eliminating this
as a possible use case. e,g:
// This is not copyable, but it is moveable
struct Thing {
Thing();
Thing(Thing&&);
Thing& operator=(Thing&&);
friend std::istream& operator>>(std::istream& is, Thing& t);
// ...
};
auto get_things(std::istream& is) -> std::vector<Thing>
{
std::size_t N = 0;
is >> N;
std::vector<Thing> result;
result.reserve(N);
// cannot compile
// std::copy_n(std::istream_iterator<Thing>(is), N,
std::back_inserter(result));
// and this still can't compile because istream_iterator::operator*()
returns a const reference
std::move_n(std::istream_iterator<Thing>(is), N,
std::back_inserter(result));
return result;
}
>
> --
> 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/ab347eb7-27d8-4a1d-92d6-2be25eabf02f%40isocpp.org
> .
>
--
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/CALvx3hbjOdpTshMfy-z-Vi5rEzqJJKmN1LX5_a9GMAsJ%2Bv2g1g%40mail.gmail.com.
--000000000000a1b509056f8f1e51
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue=
, 26 Jun 2018 at 19:22, Ryan Nicholl <<a href=3D"mailto:r.p.nicholl@gmai=
l.com">r.p.nicholl@gmail.com</a>> wrote:<br></div><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204=
,204,204);padding-left:1ex">Disagree. ```std::move_n``` should be added for=
consistency. C++ is multi-paradigm and not everyone will use ranges.<br></=
blockquote><div><br></div><div>I was about to agree with you, thinking that=
this would be useful for deserialising non-copyable objects from a stream.=
But then I realised that std::istream_operator<T>::operator*() retur=
ns a const ref, eliminating this as a possible use case. e,g:</div><div><br=
></div><div><div><font face=3D"monospace, monospace">// This is not copyabl=
e, but it is moveable</font></div><div><font face=3D"monospace, monospace">=
struct Thing {</font></div><div><font face=3D"monospace, monospace">=C2=A0 =
=C2=A0 Thing();</font></div><div><font face=3D"monospace, monospace">=C2=A0=
=C2=A0 Thing(Thing&&);</font></div><div><font face=3D"monospace, m=
onospace">=C2=A0 =C2=A0 Thing& operator=3D(Thing&&);</font></di=
v><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 friend std::istrea=
m& operator>>(std::istream& is, Thing& t);</font></div><d=
iv><font face=3D"monospace, monospace">=C2=A0 =C2=A0 // ...</font></div><di=
v><font face=3D"monospace, monospace">};</font></div><div><font face=3D"mon=
ospace, monospace"><br></font></div><div><div><font face=3D"monospace, mono=
space">auto get_things(std::istream& is) -> std::vector<Thing>=
</font></div><div><font face=3D"monospace, monospace">{</font></div><div><f=
ont face=3D"monospace, monospace">=C2=A0 =C2=A0 std::size_t N =3D 0;</font>=
</div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 is >> N;=
</font></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 std::ve=
ctor<Thing> result;</font></div><div><font face=3D"monospace, monospa=
ce">=C2=A0 =C2=A0 result.reserve(N);</font></div><div><font face=3D"monospa=
ce, monospace"><br></font></div><div><font face=3D"monospace, monospace">=
=C2=A0 =C2=A0 // cannot compile</font></div><div><font face=3D"monospace, m=
onospace">=C2=A0 =C2=A0 // std::copy_n(std::istream_iterator<Thing>(i=
s), N, std::back_inserter(result));</font></div><div><font face=3D"monospac=
e, monospace"><br></font></div><div><font face=3D"monospace, monospace">=C2=
=A0 =C2=A0 // and this still can't compile because istream_iterator::op=
erator*() returns a const reference</font></div><div><font face=3D"monospac=
e, monospace">=C2=A0 =C2=A0 std::move_n(std::istream_iterator<Thing>(=
is), N, std::back_inserter(result));</font></div><div><font face=3D"monospa=
ce, monospace"><br></font></div><div><font face=3D"monospace, monospace">=
=C2=A0 =C2=A0 return result;</font></div><div><font face=3D"monospace, mono=
space">}</font></div></div><div><br></div></div><div><br></div><div>=C2=A0<=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@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>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/ab347eb7-27d8-4a1d-92d6-2be25eabf02f%=
40isocpp.org" rel=3D"noreferrer" target=3D"_blank">https://groups.google.co=
m/a/isocpp.org/d/msgid/std-proposals/ab347eb7-27d8-4a1d-92d6-2be25eabf02f%4=
0isocpp.org</a>.<br>
</blockquote></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CALvx3hbjOdpTshMfy-z-Vi5rEzqJJKmN1LX5=
_a9GMAsJ%2Bv2g1g%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hbjOdpTsh=
Mfy-z-Vi5rEzqJJKmN1LX5_a9GMAsJ%2Bv2g1g%40mail.gmail.com</a>.<br />
--000000000000a1b509056f8f1e51--
.
Author: Vishal Oza <vickoza@gmail.com>
Date: Tue, 26 Jun 2018 11:13:02 -0700 (PDT)
Raw View
------=_Part_11492_2105393842.1530036782292
Content-Type: multipart/alternative;
boundary="----=_Part_11493_1538486369.1530036782293"
------=_Part_11493_1538486369.1530036782293
Content-Type: text/plain; charset="UTF-8"
I think that algorithms move should be renamed as std::move is different
from the algorithms move to distinguish between the two I thing the
algorithms version should be called std::transfer
On Tuesday, June 26, 2018 at 12:49:30 PM UTC-5, Richard Hodges wrote:
>
>
>
> On Tue, 26 Jun 2018 at 19:22, Ryan Nicholl <r.p.n...@gmail.com
> <javascript:>> wrote:
>
>> Disagree. ```std::move_n``` should be added for consistency. C++ is
>> multi-paradigm and not everyone will use ranges.
>>
>
> I was about to agree with you, thinking that this would be useful for
> deserialising non-copyable objects from a stream. But then I realised that
> std::istream_operator<T>::operator*() returns a const ref, eliminating this
> as a possible use case. e,g:
>
> // This is not copyable, but it is moveable
> struct Thing {
> Thing();
> Thing(Thing&&);
> Thing& operator=(Thing&&);
> friend std::istream& operator>>(std::istream& is, Thing& t);
> // ...
> };
>
> auto get_things(std::istream& is) -> std::vector<Thing>
> {
> std::size_t N = 0;
> is >> N;
> std::vector<Thing> result;
> result.reserve(N);
>
> // cannot compile
> // std::copy_n(std::istream_iterator<Thing>(is), N,
> std::back_inserter(result));
>
> // and this still can't compile because istream_iterator::operator*()
> returns a const reference
> std::move_n(std::istream_iterator<Thing>(is), N,
> std::back_inserter(result));
>
> return result;
> }
>
>
>
>
>>
>> --
>> 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-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ab347eb7-27d8-4a1d-92d6-2be25eabf02f%40isocpp.org
>> .
>>
>
--
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/8076cd63-d04b-4df1-8937-813f33778ae1%40isocpp.org.
------=_Part_11493_1538486369.1530036782293
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I think that algorithms move should be renamed as std::mov=
e is different from the algorithms move to distinguish between the two I th=
ing the algorithms version should be called std::transfer<br><br>On Tuesday=
, June 26, 2018 at 12:49:30 PM UTC-5, Richard Hodges wrote:<blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #c=
cc solid;padding-left: 1ex;"><div dir=3D"ltr"><br><br><div class=3D"gmail_q=
uote"><div dir=3D"ltr">On Tue, 26 Jun 2018 at 19:22, Ryan Nicholl <<a hr=
ef=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"UYQKkHAoBAAJ"=
rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:';return t=
rue;" onclick=3D"this.href=3D'javascript:';return true;">r.p.n...@g=
mail.com</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">Disagree. ```std::move_n``` should be added for consistency. C++ is=
multi-paradigm and not everyone will use ranges.<br></blockquote><div><br>=
</div><div>I was about to agree with you, thinking that this would be usefu=
l for deserialising non-copyable objects from a stream. But then I realised=
that std::istream_operator<T>::<wbr>operator*() returns a const ref,=
eliminating this as a possible use case. e,g:</div><div><br></div><div><di=
v><font face=3D"monospace, monospace">// This is not copyable, but it is mo=
veable</font></div><div><font face=3D"monospace, monospace">struct Thing {<=
/font></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 Thing();=
</font></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 Thing(T=
hing&&);</font></div><div><font face=3D"monospace, monospace">=C2=
=A0 =C2=A0 Thing& operator=3D(Thing&&);</font></div><div><font =
face=3D"monospace, monospace">=C2=A0 =C2=A0 friend std::istream& operat=
or>>(std::istream& is, Thing& t);</font></div><div><font face=
=3D"monospace, monospace">=C2=A0 =C2=A0 // ...</font></div><div><font face=
=3D"monospace, monospace">};</font></div><div><font face=3D"monospace, mono=
space"><br></font></div><div><div><font face=3D"monospace, monospace">auto =
get_things(std::istream& is) -> std::vector<Thing></font></div=
><div><font face=3D"monospace, monospace">{</font></div><div><font face=3D"=
monospace, monospace">=C2=A0 =C2=A0 std::size_t N =3D 0;</font></div><div><=
font face=3D"monospace, monospace">=C2=A0 =C2=A0 is >> N;</font></div=
><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 std::vector<Thin=
g> result;</font></div><div><font face=3D"monospace, monospace">=C2=A0 =
=C2=A0 result.reserve(N);</font></div><div><font face=3D"monospace, monospa=
ce"><br></font></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0=
// cannot compile</font></div><div><font face=3D"monospace, monospace">=C2=
=A0 =C2=A0 // std::copy_n(std::istream_<wbr>iterator<Thing>(is), N, s=
td::back_inserter(result));</font></div><div><font face=3D"monospace, monos=
pace"><br></font></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=
=A0 // and this still can't compile because istream_iterator::operator*=
() returns a const reference</font></div><div><font face=3D"monospace, mono=
space">=C2=A0 =C2=A0 std::move_n(std::istream_<wbr>iterator<Thing>(is=
), N, std::back_inserter(result));</font></div><div><font face=3D"monospace=
, monospace"><br></font></div><div><font face=3D"monospace, monospace">=C2=
=A0 =C2=A0 return result;</font></div><div><font face=3D"monospace, monospa=
ce">}</font></div></div><div><br></div></div><div><br></div><div>=C2=A0</di=
v><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
UYQKkHAoBAAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:&=
#39;;return true;" onclick=3D"this.href=3D'javascript:';return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"UYQKkHAoBAAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'=
;javascript:';return true;">std-pr...@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/ab347eb7-27d8-4a1d-92d6-2be25eabf02f%=
40isocpp.org" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=
=3D'https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ab347e=
b7-27d8-4a1d-92d6-2be25eabf02f%40isocpp.org';return true;" onclick=3D"t=
his.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/std-proposal=
s/ab347eb7-27d8-4a1d-92d6-2be25eabf02f%40isocpp.org';return true;">http=
s://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/ab347eb7=
-27d8-4a1d-<wbr>92d6-2be25eabf02f%40isocpp.org</a><wbr>.<br>
</blockquote></div></div>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/8076cd63-d04b-4df1-8937-813f33778ae1%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8076cd63-d04b-4df1-8937-813f33778ae1=
%40isocpp.org</a>.<br />
------=_Part_11493_1538486369.1530036782293--
------=_Part_11492_2105393842.1530036782292--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 26 Jun 2018 13:44:06 -0700 (PDT)
Raw View
------=_Part_44848_789212817.1530045846858
Content-Type: multipart/alternative;
boundary="----=_Part_44849_682788378.1530045846858"
------=_Part_44849_682788378.1530045846858
Content-Type: text/plain; charset="UTF-8"
On Tuesday, June 26, 2018 at 1:22:09 PM UTC-4, Ryan Nicholl wrote:
>
> Disagree. ```std::move_n``` should be added for consistency. C++ is
> multi-paradigm and not everyone will use ranges.
If your intent is for `std::move_n` to work like `std::copy_n`, then you
*have* to have a range. Oh sure, it's not a traditional iterator range, but
it's still a range. And the Range TS even has provisions for a counted
range:
std::ranges::move(std::counted_iterator(it, size), std::default_sentinel{},
output);
It's not the most obvious of code, but it is adequate. I have my own helper
class that would let me do this:
std::ranges::move(to_range(crange{size}, it), output);
Where `crange` is a position+size (which also doubles as a range type) and
`to_range` applies position+size's to an iterator or range, returning an
appropriate iterator range.
--
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/a95be7c0-8187-4b44-8059-b0de0ca331d1%40isocpp.org.
------=_Part_44849_682788378.1530045846858
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Tuesday, June 26, 2018 at 1:22:09 PM UTC-4, Ryan Nichol=
l wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0=
..8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Disagree. ```std::move=
_n``` should be added for consistency. C++ is multi-paradigm and not everyo=
ne will use ranges.</blockquote><div><br></div><div>If your intent is for `=
std::move_n` to work like `std::copy_n`, then you <i>have</i> to have a ran=
ge. Oh sure, it's not a traditional iterator range, but it's still =
a range. And the Range TS even has provisions for a counted range:</div><di=
v><br></div><div><div style=3D"background-color: rgb(250, 250, 250); border=
-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflo=
w-wrap: break-word;" class=3D"prettyprint"><code class=3D"prettyprint"><div=
class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">std</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">ranges=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">move</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify">std</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">counted_iterator</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">it</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> size</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">),</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> std</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">default_sentinel</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">{},</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> output</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">);</span></div></code></=
div><br></div><div>It's not the most obvious of code, but it is adequat=
e. I have my own helper class that would let me do this:</div><div><br></di=
v><div><div style=3D"background-color: rgb(250, 250, 250); border-color: rg=
b(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: br=
eak-word;" class=3D"prettyprint"><code class=3D"prettyprint"><div class=3D"=
subprettyprint"><span style=3D"color: #000;" class=3D"styled-by-prettify">s=
td</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify">ranges</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">move</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">to_range</span><span style=3D"color: #660;"=
class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">crange</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify">size</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">},</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> it</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">),</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> output</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">);</span></div></code></=
div><br></div><div>Where `crange` is a position+size (which also doubles as=
a range type) and `to_range` applies position+size's to an iterator or=
range, returning an appropriate iterator range.<br></div><div><br></div><d=
iv><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/a95be7c0-8187-4b44-8059-b0de0ca331d1%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a95be7c0-8187-4b44-8059-b0de0ca331d1=
%40isocpp.org</a>.<br />
------=_Part_44849_682788378.1530045846858--
------=_Part_44848_789212817.1530045846858--
.
Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Tue, 26 Jun 2018 17:01:18 -0400
Raw View
On 2018-06-26 13:22, Ryan Nicholl wrote:
> Disagree. ```std::move_n``` should be added for consistency. C++ is multi-paradigm and not everyone will use ranges.
I can't agree. That's like saying "not everyone will use classes,
therefore we should add a C-style interface for working with containers".
No, sorry; there is (and should be) a preferred paradigm that we will
support. Anyone that doesn't want to use it... well, too bad.
--
Matthew
--
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/969b71bf-75d6-31af-d98c-a1daff6beed6%40gmail.com.
.