220 6213 <CAGNvRgBYyN5HHMuKSMpxSBrUc7OMUf8C+aE96h4QM2PkmS7Z6w@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Specialization of std::stack for std::forward_list
Date: Sat, 7 Sep 2013 12:32:37 +0200
Lines: 130
Approved: news@gmane.org
Message-ID: <CAGNvRgBYyN5HHMuKSMpxSBrUc7OMUf8C+aE96h4QM2PkmS7Z6w@mail.gmail.com>
References: <d51e20f7-665e-49f7-a3e8-caed3660563f@isocpp.org>
	<CAGNvRgDd2KS+MVM0tXHTTO7nk=9BCEcrCdtnKweySr7b0L=bmA@mail.gmail.com>
	<419bda08-54a2-43e7-8dd7-ade5bf47cf88@isocpp.org>
	<CAGNvRgDUNb04tC-5zXSfPoonBay_aY2A-br0LK2w3J1yOdS8Nw@mail.gmail.com>
	<CAOHCbisi7GHw8MSZDkpND=cYGn2nyWFKPpG_EkZ2Lyz1cn1Rbw@mail.gmail.com>
	<CAGNvRgC0uTfZfuzej57xU-ds=TKCwSGN_rVwfasuipqO2sZb=g@mail.gmail.com>
	<CAOHCbiu_66-FnRaB_-J7rv=kTGUd28KZ8aAH_isOVcYdOKpaoQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c2b36a8306b404e5c8acdb
X-Trace: ger.gmane.org 1378549956 11298 80.91.229.3 (7 Sep 2013 10:32:36 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 7 Sep 2013 10:32:36 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCT7RVFA4QORBRUBVSIQKGQES3CGHWQ@isocpp.org Sat Sep 07 12:32:40 2013
Return-path: <std-proposals+bncBCT7RVFA4QORBRUBVSIQKGQES3CGHWQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-bk0-f71.google.com ([209.85.214.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCT7RVFA4QORBRUBVSIQKGQES3CGHWQ@isocpp.org>)
	id 1VIFol-0005LZ-Dk
	for gclcip-std-proposals@m.gmane.org; Sat, 07 Sep 2013 12:32:39 +0200
Original-Received: by mail-bk0-f71.google.com with SMTP id e11sf3461601bkh.2
        for <gclcip-std-proposals@m.gmane.org>; Sat, 07 Sep 2013 03:32:38 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=LZPbiqCsep5y5snGi9tkl3CDwhVbWpEQIJmdfVu4IYg=;
        b=QVSCseZyJxBj6E00CYk2PdFQRp6UOlf0RoTEvfXj7ZQcoxP/vEdaCPGUvM6RcvqrGh
         DMl+YrJJZGjIKkn6V3X4f7x5F8xrbmh6udDHVVAsZBcUGOog3E9FeffX5oxRwqnMYcee
         OQk40m1xzCkl8HpHrAihd9bJhzNj535doI7OakACY10+HQ4iJbU/9MkKosi/J1MBWwf1
         ubH9hP01D+316JIe7sQBlcsxEmwpyXqG2KQNrmCw9FmQq+M9ELWFkpyC5gvy/yCA7+kx
         o2iSw/Pdbahs/ptKDBcuY33Ix67EMwQyw3JshJ6n81MXwX3BIEXeZH4kTr6jTZ/hP6WM
         BkEA==
X-Received: by 10.180.80.227 with SMTP id u3mr693573wix.5.1378549958809;
        Sat, 07 Sep 2013 03:32:38 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.88.106 with SMTP id bf10ls356653wib.17.gmail; Sat, 07 Sep
 2013 03:32:37 -0700 (PDT)
X-Received: by 10.180.13.13 with SMTP id d13mr1765058wic.34.1378549957678;
        Sat, 07 Sep 2013 03:32:37 -0700 (PDT)
Original-Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [2a00:1450:400c:c00::22c])
        by mx.google.com with ESMTPS id q5si947222wij.24.1969.12.31.16.00.00
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 07 Sep 2013 03:32:37 -0700 (PDT)
Received-SPF: pass (google.com: domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c00::22c as permitted sender) client-ip=2a00:1450:400c:c00::22c;
Original-Received: by mail-wg0-f44.google.com with SMTP id b12so2640789wgh.11
        for <std-proposals@isocpp.org>; Sat, 07 Sep 2013 03:32:37 -0700 (PDT)
X-Received: by 10.180.10.136 with SMTP id i8mr1743063wib.46.1378549957328;
 Sat, 07 Sep 2013 03:32:37 -0700 (PDT)
Original-Received: by 10.216.153.8 with HTTP; Sat, 7 Sep 2013 03:32:37 -0700 (PDT)
In-Reply-To: <CAOHCbiu_66-FnRaB_-J7rv=kTGUd28KZ8aAH_isOVcYdOKpaoQ@mail.gmail.com>
X-Original-Sender: daniel.kruegler@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c00::22c as
 permitted sender) smtp.mail=daniel.kruegler@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:6213
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/6213>

--001a11c2b36a8306b404e5c8acdb
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

2013/9/7 Tony V E <tvaneerd@gmail.com>

>
> On Fri, Sep 6, 2013 at 5:01 PM, Daniel Kr=FCgler <daniel.kruegler@gmail.c=
om>wrote:
>
>> >
>> > Bit of a tangent here - I'm surprised forward_list doesn't have a
>> size(),
>> > since, as you say, it wouldn't be hard to implement.
>>
>> See
>>
>> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2543.htm
>>
>> for the design rationale, especially regarding the omission of size().
>>
>>
> Thanks for the link.  Note that it says:
>
> "Note that similar considerations apply to std::list::size()."
>
> Which, (IIUC) at the time, didn't require O(1) size(), but now does.
> Wonder if forward_list is worth revisiting.
>

For std::list there was decision to make in regard to trade-of between
size() and splice(), see

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2923.pdf

But list was a container that should *fully* satisfy the container
requirements, therefore the size() member existed from the C++98. Here we
had not choice to remove size() from list.

For forward_list the design idea was intentionally not to satisfy the
container requirements, but instead to provide a type that does not take
more space or time overhead relative to a hand-written C-style singly
linked list, see the note added to [forwardlist.overview] p1, especially
"Features that would conflict with that goal have been omitted." and the
text in above quoted paper. It is certainly possible to add a size() member
with O(1) guarantee but that would conflict with the design idea. Of-course
reconsidering previous ideas is always possible, but would probably require
a paper that provides some convincing arguments for such a change.

- Daniel

--=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/.

--001a11c2b36a8306b404e5c8acdb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><div class=3D"gmail_quote">=
2013/9/7 Tony V E <span dir=3D"ltr">&lt;<a href=3D"mailto:tvaneerd@gmail.co=
m" target=3D"_blank">tvaneerd@gmail.com</a>&gt;</span><br><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">
<div dir=3D"ltr"><div class=3D"im"><br><div class=3D"gmail_extra"><div clas=
s=3D"gmail_quote">On Fri, Sep 6, 2013 at 5:01 PM, Daniel Kr=FCgler <span di=
r=3D"ltr">&lt;<a href=3D"mailto:daniel.kruegler@gmail.com" target=3D"_blank=
">daniel.kruegler@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">&gt;<br><div>
&gt; Bit of a tangent here - I&#39;m surprised forward_list doesn&#39;t hav=
e a size(),<br>
&gt; since, as you say, it wouldn&#39;t be hard to implement.<br>
<br>
</div>See<br>
<br>
<a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2543.ht=
m" target=3D"_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/200=
8/n2543.htm</a><br>
<br>
for the design rationale, especially regarding the omission of size().<br>
<br></blockquote></div><br></div></div><div class=3D"gmail_extra">Thanks fo=
r the link.=A0 Note that it says:<br><br>&quot;Note that similar considerat=
ions apply to
<span style=3D"font-family:Courier New">std::list::size()</span>.&quot;<br>=
<br></div><div class=3D"gmail_extra">Which, (IIUC) at the time, didn&#39;t =
require O(1) size(), but now does.=A0 Wonder if forward_list is worth revis=
iting.<br>
</div></div></blockquote><div><br></div></div>For std::list there was decis=
ion to make in regard to trade-of between size() and splice(), see<br><br><=
a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2923.pdf=
">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2923.pdf</a><br>
<br></div><div class=3D"gmail_extra">But list was a container that should *=
fully* satisfy the container requirements, therefore the size() member exis=
ted from the C++98. Here we had not choice to remove size() from list.<br>
<br>For forward_list the design idea was intentionally not to satisfy the c=
ontainer requirements, but instead to provide a type that does not take mor=
e space or time overhead relative to a hand-written C-style singly linked l=
ist, see the note added to [forwardlist.overview] p1, especially &quot;Feat=
ures that would conflict with that goal have been omitted.&quot; and the te=
xt in above quoted paper. It is certainly possible to add a size() member w=
ith O(1) guarantee but that would conflict with the design idea. Of-course =
reconsidering previous ideas is always possible, but would probably require=
 a paper that provides some convincing arguments for such a change.<br>
<br></div><div class=3D"gmail_extra">- Daniel<br></div></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />

--001a11c2b36a8306b404e5c8acdb--

.
