Topic: Standard container(or iterator)-specialized


Author: David Krauss <potswa@gmail.com>
Date: Fri, 1 May 2015 14:34:52 +0800
Raw View
--Apple-Mail=_879F4745-1948-4F27-BAC7-BCB24381BB1E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9305=E2=80=9301, at 1:02 PM, NDos Dannyu <ndospark320@naver=
..com> wrote:
>=20
> without invalidating any iterators

More precisely, without changing the values of any element objects. In many=
 use-cases the point of running the algorithm is to manipulate the objects =
in-place.

There might be a case for introducing std::list::rotate, but that can alrea=
dy be synthesized from splice, and I think that style is easier to understa=
nd for swap and swap_range.

> For std::vector and std::deque, std::sort would behave differently, as we=
 can probably yield sorted range with the range "slided" up or down, and th=
en just adjust the begin iterator.


No existing implementation of vector would support that, and I don=E2=80=99=
t see how it helps anyway.

(You could rotate a deque by shuffling the pages, but the optimization woul=
d depend on precise alignment of the stars.)

--=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/.

--Apple-Mail=_879F4745-1948-4F27-BAC7-BCB24381BB1E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9305=
=E2=80=9301, at 1:02 PM, NDos Dannyu &lt;<a href=3D"mailto:ndospark320@nave=
r.com" class=3D"">ndospark320@naver.com</a>&gt; wrote:</div><br class=3D"Ap=
ple-interchange-newline"><div class=3D""><span style=3D"font-family: Helvet=
ica; font-size: 12px; font-style: normal; font-variant: normal; font-weight=
: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-=
align: start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: non=
e; display: inline !important;" class=3D"">without invalidating any iterato=
rs</span></div></blockquote></div><br class=3D""><div class=3D"">More preci=
sely, without changing the values of any element objects. In many use-cases=
 the point of running the algorithm is to manipulate the objects in-place.<=
/div><div class=3D""><br class=3D""></div><div class=3D"">There might be a =
case for introducing&nbsp;<font face=3D"Courier" class=3D"">std::list::rota=
te</font>, but that can already be synthesized from <font face=3D"Courier" =
class=3D"">splice</font>, and I think that style is easier to understand fo=
r <font face=3D"Courier" class=3D"">swap</font> and <font face=3D"Courier" =
class=3D"">swap_range</font>.</div><div class=3D""><br class=3D""></div><di=
v class=3D""><blockquote type=3D"cite" class=3D"">For&nbsp;<strong class=3D=
"">std::vector</strong>&nbsp;and&nbsp;<strong class=3D"">std::deque</strong=
>, std::sort&nbsp;would behave differently, as we can probably yield sorted=
 range with the range "slided" up or down, and then just adjust the begin i=
terator.</blockquote></div><div class=3D""><br class=3D""></div><div class=
=3D"">No existing implementation of <font face=3D"Courier" class=3D"">vecto=
r</font> would support that, and I don=E2=80=99t see how it helps anyway.</=
div><div class=3D""><br class=3D""></div><div class=3D"">(You could <font f=
ace=3D"Courier" class=3D"">rotate</font> a <font face=3D"Courier" class=3D"=
">deque</font>&nbsp;by shuffling the pages, but the optimization would depe=
nd on precise alignment of the stars.)</div></body></html>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_879F4745-1948-4F27-BAC7-BCB24381BB1E--

.


Author: NDos Dannyu <ndospark320@naver.com>
Date: Fri, 1 May 2015 00:20:36 -0700 (PDT)
Raw View
------=_Part_677_583755574.1430464836492
Content-Type: multipart/alternative;
 boundary="----=_Part_678_1474632722.1430464836492"

------=_Part_678_1474632722.1430464836492
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable


>
> > No existing implementation of vector would support that,
>>
> Really? Why? I thought it is possible...
> > and I don=E2=80=99t see how it helps anyway.
> It would probably require less operations...
>
>
> No existing implementation of vector would support that,
>
Really? Why? I thought it is possible...
> and I don=E2=80=99t see how it helps anyway.
It would probably require less operations...
=20

--=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/.

------=_Part_678_1474632722.1430464836492
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px=
 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); borde=
r-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div><blockq=
uote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left=
: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; borde=
r-left-style: solid;"><div dir=3D"ltr"><div>&gt; No existing implementation=
 of <font face=3D"Courier">vector</font> would support that,<br></div></div=
></blockquote><div>Really? Why? I thought it is possible...</div><div>&gt; =
and I don=E2=80=99t see how it helps anyway.</div><div>It would probably re=
quire less operations...</div><br></div></div></blockquote><div><br></div><=
div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; p=
adding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width:=
 1px; border-left-style: solid;"><div dir=3D"ltr"><div>&gt; No existing imp=
lementation of <font face=3D"Courier">vector</font> would support that,<br>=
</div></div></blockquote><div>Really? Why? I thought it is possible...</div=
><div>&gt; and I don=E2=80=99t see how it helps anyway.</div><div>It would =
probably require less operations...</div>&nbsp;</div></div>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_678_1474632722.1430464836492--
------=_Part_677_583755574.1430464836492--

.