220 7652 <CAFk2RUZYvC8_vtSbQfTMUs64yego-ZgGK1qcD1tZJT9g4OOVDg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Could we remove the size() method in the std::list<T>?
Date: Sat, 9 Nov 2013 20:00:42 +0200
Lines: 123
Approved: news@gmane.org
Message-ID: <CAFk2RUZYvC8_vtSbQfTMUs64yego-ZgGK1qcD1tZJT9g4OOVDg@mail.gmail.com>
References: <9be1f793-a061-4193-8a91-eedc81fa703e@isocpp.org>
	<433a9ee1-0ae3-4af7-ad93-028e416075ad@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c2b762059f9504eac2471d
X-Trace: ger.gmane.org 1384020040 19215 80.91.229.3 (9 Nov 2013 18:00:40 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 9 Nov 2013 18:00:40 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBS7Q7GJQKGQEW6CPFWI@isocpp.org Sat Nov 09 19:00:45 2013
Return-path: <std-proposals+bncBC5JHI7A7ALRBS7Q7GJQKGQEW6CPFWI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-gg0-f200.google.com ([209.85.161.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBS7Q7GJQKGQEW6CPFWI@isocpp.org>)
	id 1VfCpx-0006gt-Eu
	for gclcip-std-proposals@m.gmane.org; Sat, 09 Nov 2013 19:00:45 +0100
Original-Received: by mail-gg0-f200.google.com with SMTP id p4sf4559044ggn.11
        for <gclcip-std-proposals@m.gmane.org>; Sat, 09 Nov 2013 10:00:44 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state: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=54CjGinQSQwlvNuttuY2U2AYNjr3O3xg2SCOE4FVL54=;
        b=JWY3dCy1PpP2ZIKDb/J7a07U/dqNw5eFugEzd6ianFmvzHYETKyRyVeRawcXfi2THV
         RyVg610GolVXgxk/HgQlk2wY8SSENl/CXnI8sRVYcEEDvhKA7JjZQGCTC6/BKEq0cjsA
         xCvpNc5kcnOFizWPEfDbr5jbgpwJehpDTz2ZtS+O/luUKhkQr/IusXPYU4F3FsDFt2HF
         xBcUDgbu4wS0Csfe24nzxTg3K7sWCMHAjdLMjO4JxCD2ytdnszdQQM9rUok8LDD8+l1W
         lTAzyfPSb96aFJPyG014DZpYUU3ZD+0wLAC+n6LB4pkqcfnB8sEiMvy2zvHr9QFliOON
         uP0g==
X-Gm-Message-State: ALoCoQlq0MxrigA5RG1i/N8Ki0vkGm/va5hdnJJ/H+/3xDHJvpd4wiBf4lxpNOPbMX1WqS1nwHw4
X-Received: by 10.58.112.195 with SMTP id is3mr6711361veb.29.1384020044438;
        Sat, 09 Nov 2013 10:00:44 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.95.161 with SMTP id dl1ls1986764qeb.60.gmail; Sat, 09 Nov
 2013 10:00:43 -0800 (PST)
X-Received: by 10.224.87.198 with SMTP id x6mr34507228qal.61.1384020043081;
        Sat, 09 Nov 2013 10:00:43 -0800 (PST)
Original-Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [2607:f8b0:400d:c01::22f])
        by mx.google.com with ESMTPS id nf5si6076631qeb.10.2013.11.09.10.00.43
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 09 Nov 2013 10:00:43 -0800 (PST)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c01::22f as permitted sender) client-ip=2607:f8b0:400d:c01::22f;
Original-Received: by mail-qc0-f175.google.com with SMTP id e16so2833922qcx.20
        for <std-proposals@isocpp.org>; Sat, 09 Nov 2013 10:00:43 -0800 (PST)
X-Received: by 10.224.66.5 with SMTP id l5mr34683431qai.31.1384020042946; Sat,
 09 Nov 2013 10:00:42 -0800 (PST)
Original-Received: by 10.224.11.197 with HTTP; Sat, 9 Nov 2013 10:00:42 -0800 (PST)
In-Reply-To: <433a9ee1-0ae3-4af7-ad93-028e416075ad@isocpp.org>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c01::22f as
 permitted sender) smtp.mail=ville.voutilainen@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:7652
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7652>

--001a11c2b762059f9504eac2471d
Content-Type: text/plain; charset=ISO-8859-1

On 9 November 2013 18:33, <euloanty@live.com> wrote:

> 1.It makes most of the operations of std::list slower;
>

Well, "most" is debatable, and it makes many programs using std::list
faster,
in fact much faster.


> 2.std::forward_list don't have this method. This makes people
> very confused.
>

forward_list doesn't have it because it doesn't have the same complexity
guarantee for forward_list. Now that it's O(1) for std::list, containers
that
do have it have the same complexity guarantee for it.


> 3.the method splice() becomes much slower.
>

Yes, and the programs mentioned in my response to (1) become much faster.

4.We know our library couldn't make people very confused. That was why we
> didn't define the operator[] in the std::list<>;
>

I don't see why std::list::size makes anyone confused.


> 5.The function of this method can be easily implied by programmers
> themselves. We know this function had been defined clearly in cpp11, but in
> the cpp98, its time-complexity is not defined clearly. For this reason, in
> the past we almost didn't use it. So  I think this change won't make so
> many codes invalid.
>
>
>
>
I don't see how a programmer can easily implement size(). Furthermore,
changing a function's
complexity from linear to constant breaks much fewer programs than removing
a function
completely.

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--001a11c2b762059f9504eac2471d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 9 November 2013 18:33,  <span dir=3D"ltr">&lt;<a href=3D"mailto:=
euloanty@live.com" target=3D"_blank">euloanty@live.com</a>&gt;</span> wrote=
:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex">
<div dir=3D"ltr"><div>1.It makes most of the operations of=A0std::list slow=
er;</div></div></blockquote><div><br></div><div>Well, &quot;most&quot; is d=
ebatable, and it makes many programs using std::list faster,<br>in fact muc=
h faster.<br>
=A0<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>2.std::fo=
rward_list don&#39;t have this method. This makes people very=A0confused.</=
div></div>
</blockquote><div><br></div><div>forward_list doesn&#39;t have it because i=
t doesn&#39;t have the same complexity<br></div><div>guarantee for forward_=
list. Now that it&#39;s O(1) for std::list, containers that<br>do have it h=
ave the same complexity guarantee for it.<br>
=A0<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>3.the met=
hod=A0splice() becomes much slower.</div></div></blockquote><div><br></div>=
<div>Yes, and the programs mentioned in my response to (1) become much fast=
er.<br>
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>4.We know ou=
r library couldn&#39;t make people very confused. That was=A0why we didn&#3=
9;t define the operator[] in the std::list&lt;&gt;;</div>
</div></blockquote><div><br></div><div>I don&#39;t see why std::list::size =
makes anyone confused.<br>=A0<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div =
dir=3D"ltr">
<div>5.The function of this method can=A0be easily implied by programmers t=
hemselves. We know this function had been defined clearly=A0in cpp11,=A0but=
 in the cpp98, its time-complexity is not defined clearly. For this reason,=
=A0in the past we=A0almost didn&#39;t=A0use it. So =A0I think this change w=
on&#39;t make so many codes invalid.<br>
</div></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

<br><br></div></div></blockquote><div><br></div><div>I don&#39;t see how a =
programmer can easily implement size(). Furthermore, changing a function&#3=
9;s<br>complexity from linear to constant breaks much fewer programs than r=
emoving a function<br>
completely. <br></div></div><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 />

--001a11c2b762059f9504eac2471d--

.
