220 7654 <CD8CC325-026A-4020-812A-AAF9927B9BBE@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Howard Hinnant <howard.hinnant@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 14:53:47 -0500
Lines: 42
Approved: news@gmane.org
Message-ID: <CD8CC325-026A-4020-812A-AAF9927B9BBE@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 (Mac OS X Mail 6.6 \(1510\))
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1384026826 20350 80.91.229.3 (9 Nov 2013 19:53:46 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 9 Nov 2013 19:53:46 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCK2HM4L6YERBTNF7KJQKGQESKDDKGY@isocpp.org Sat Nov 09 20:53:52 2013
Return-path: <std-proposals+bncBCK2HM4L6YERBTNF7KJQKGQESKDDKGY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f200.google.com ([209.85.214.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCK2HM4L6YERBTNF7KJQKGQESKDDKGY@isocpp.org>)
	id 1VfEbP-00075R-6k
	for gclcip-std-proposals@m.gmane.org; Sat, 09 Nov 2013 20:53:51 +0100
Original-Received: by mail-ob0-f200.google.com with SMTP id wn1sf5318165obc.7
        for <gclcip-std-proposals@m.gmane.org>; Sat, 09 Nov 2013 11:53:50 -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:subject:from:in-reply-to:date
         :message-id:references: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:content-transfer-encoding;
        bh=ve5BKtQi7QkgmubJnM6a3bTm1G9hJHQHpS5aPBj8lno=;
        b=VobYyyQAejYfan38rCDK99tkCAfm6o8dXOtdxOzIxt1Z3Nbs9VBjrIjgfHkpGZR+eR
         r3DQtjSjw6qJFJxNGi4z1zJCajpBEWpEbvFhiaqIolnegy1iAqsesvR8qFX0InuIEfW7
         ttFqoJCae6HCCw0iEqht+PhWgkTs8jU05wIaQOX4twKY9o1bj5FgbwXT9BKHwj/XQPgT
         eEQAFSm78/ep5d2gH4UAP0KdSd4r2V39BJZX16MnPlDCCmKMBBqWbXvyeAh9GOZgK7FB
         0TEsKl3hGtoJGjDECYAHsF/3nhHjIGZLm1pQpiBHuuyQ+AoOZCAZT3JZ9Kls1w8JOW4U
         3q2w==
X-Gm-Message-State: ALoCoQkSrJoj9fmuLrOwYXtncdajKBajKHgzkHmHPimRV/+omrMTxY7uiX8SKqICHaIAxg2QuA0W
X-Received: by 10.182.186.105 with SMTP id fj9mr6759501obc.5.1384026830289;
        Sat, 09 Nov 2013 11:53:50 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.117.69 with SMTP id kc5ls1985569qeb.42.gmail; Sat, 09 Nov
 2013 11:53:49 -0800 (PST)
X-Received: by 10.229.244.69 with SMTP id lp5mr33407632qcb.14.1384026829697;
        Sat, 09 Nov 2013 11:53:49 -0800 (PST)
Original-Received: from mail-qc0-x236.google.com (mail-qc0-x236.google.com [2607:f8b0:400d:c01::236])
        by mx.google.com with ESMTPS id c10si4783463qea.138.2013.11.09.11.53.49
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 09 Nov 2013 11:53:49 -0800 (PST)
Received-SPF: pass (google.com: domain of howard.hinnant@gmail.com designates 2607:f8b0:400d:c01::236 as permitted sender) client-ip=2607:f8b0:400d:c01::236;
Original-Received: by mail-qc0-f182.google.com with SMTP id n7so2981921qcx.27
        for <std-proposals@isocpp.org>; Sat, 09 Nov 2013 11:53:49 -0800 (PST)
X-Received: by 10.229.244.69 with SMTP id lp5mr33407622qcb.14.1384026829547;
        Sat, 09 Nov 2013 11:53:49 -0800 (PST)
Original-Received: from [10.0.1.4] (cpe-24-59-186-27.twcny.res.rr.com. [24.59.186.27])
        by mx.google.com with ESMTPSA id p17sm31096725qak.4.2013.11.09.11.53.47
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 09 Nov 2013 11:53:48 -0800 (PST)
In-Reply-To: <433a9ee1-0ae3-4af7-ad93-028e416075ad@isocpp.org>
X-Mailer: Apple Mail (2.1510)
X-Original-Sender: howard.hinnant@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of howard.hinnant@gmail.com designates 2607:f8b0:400d:c01::236 as
 permitted sender) smtp.mail=howard.hinnant@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:7654
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7654>

On Nov 9, 2013, at 11:33 AM, euloanty@live.com wrote:

> 1.It makes most of the operations of std::list slower;
> 2.std::forward_list don't have this method. This makes people very confus=
ed.
> 3.the method splice() becomes much slower.
> 4.We know our library couldn't make people very confused. That was why we=
 didn't define the operator[] in the std::list<>;
> 5.The function of this method can be easily implied by programmers themse=
lves. We know this function had been defined clearly in cpp11, but in the c=
pp98, its time-complexity is not defined clearly. For this reason, in the p=
ast we almost didn't use it. So  I think this change won't make so many cod=
es invalid.

We can't remove the size() member of list because it would break far too mu=
ch code.

Here is an old write up of mine, but explores some of the rationale as to h=
ow we got where we are today.  It also includes a proposal for a new list::=
splice signature, that I still think is a good idea, but was firmly turned =
down by the LWG years ago.  The new list::splice signature would allow the =
client to pass in the size of the spliced range (if known) which makes this=
 splice function O(1).  And every time I've needed to splice "some from oth=
er", there is an opportunity for the client to count the range being splice=
d as the range is being created, with negligible extra cost.  I.e. creating=
 the range to be spliced is nearly always an O(N) operation for the client.

http://home.roadrunner.com/~hinnant/On_list_size.html

Howard

--=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/.

.
