220 6208 <1378528922.5505.10.camel@sara> article
Path: news.gmane.org!not-for-mail
From: Magnus Fromreide <magfr@lysator.liu.se>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Specialization of std::stack for std::forward_list
Date: Sat, 07 Sep 2013 06:42:02 +0200
Lines: 43
Approved: news@gmane.org
Message-ID: <1378528922.5505.10.camel@sara>
References: <d51e20f7-665e-49f7-a3e8-caed3660563f@isocpp.org>
	 <5b046beb-f0c0-4cd2-96bb-bc7007da13e9@isocpp.org>
	 <1111d35d-1a91-47b3-a2a4-01c2b91a6527@isocpp.org>
	 <CAOfiQqmvTsWx3oZBOMdDqM_BMwmQOm--7+n8Lw+LQ1zQtQcKgA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1378528929 20161 80.91.229.3 (7 Sep 2013 04:42:09 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 7 Sep 2013 04:42:09 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDELLREETMBRBIW5VKIQKGQEDVQPV6I@isocpp.org Sat Sep 07 06:42:12 2013
Return-path: <std-proposals+bncBDELLREETMBRBIW5VKIQKGQEDVQPV6I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-we0-f200.google.com ([74.125.82.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDELLREETMBRBIW5VKIQKGQEDVQPV6I@isocpp.org>)
	id 1VIALb-0002AF-GQ
	for gclcip-std-proposals@m.gmane.org; Sat, 07 Sep 2013 06:42:11 +0200
Original-Received: by mail-we0-f200.google.com with SMTP id u56sf2414829wes.7
        for <gclcip-std-proposals@m.gmane.org>; Fri, 06 Sep 2013 21:42:11 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=message-id:subject:from:to:date:in-reply-to:references:mime-version
         :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=dsiWDQIQGNgDr/6a9+shPHW1qTAJrxg+Z2NeSYHesnE=;
        b=MXyXSmqH5HeWA6XIVcvZ03zgYV9IPibEpRbLaLyQUMSYOlWZx25PwFmEUtxOOadFtg
         CFjDGfiw7bob33+s6D/svxrlNo+Bo1I4O26S+NWX30YOFPKdb+Cnktt8O5NQMWGBYaLx
         L4JmqnJb1Y5ENguOjeqZWzP/w5rCqE0E4AOILshFt53l1wxRvOC4iMauuIUVP7hfEWN6
         1qHS2fy7uBgiqRtwlkbYmT0TYjOQ5/vuO6TwzpRdQ0xlf2hq2neXuJChGW/iUmfk1PYi
         XHveksWwRl1zYjNVkKgdfz83gVNoD+12Irak9maHTOOX/pZ42R3UDfFtGjUZ9vh1jAwK
         FB5Q==
X-Received: by 10.180.189.3 with SMTP id ge3mr400141wic.4.1378528931013;
        Fri, 06 Sep 2013 21:42:11 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.228.39 with SMTP id sf7ls302096wic.54.canary; Fri, 06 Sep
 2013 21:42:10 -0700 (PDT)
X-Received: by 10.204.103.199 with SMTP id l7mr5301399bko.11.1378528929795;
        Fri, 06 Sep 2013 21:42:09 -0700 (PDT)
Original-Received: from mail.lysator.liu.se (mail.lysator.liu.se. [2001:6b0:17:f0a0::3])
        by mx.google.com with ESMTPS id ki1si103981bkb.99.1969.12.31.16.00.00
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Fri, 06 Sep 2013 21:42:09 -0700 (PDT)
Received-SPF: pass (google.com: domain of magfr@lysator.liu.se designates 2001:6b0:17:f0a0::3 as permitted sender) client-ip=2001:6b0:17:f0a0::3;
Original-Received: from mail.lysator.liu.se (localhost [127.0.0.1])
	by mail.lysator.liu.se (Postfix) with ESMTP id D8C3A4000C
	for <std-proposals@isocpp.org>; Sat,  7 Sep 2013 06:42:08 +0200 (CEST)
Original-Received: from [192.168.0.101] (h-176-10-249-241.na.cust.bahnhof.se [176.10.249.241])
	(using SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.lysator.liu.se (Postfix) with ESMTPSA id B07A640009
	for <std-proposals@isocpp.org>; Sat,  7 Sep 2013 06:42:08 +0200 (CEST)
In-Reply-To: <CAOfiQqmvTsWx3oZBOMdDqM_BMwmQOm--7+n8Lw+LQ1zQtQcKgA@mail.gmail.com>
X-Mailer: Evolution 3.4.4-4+b1
X-Virus-Scanned: ClamAV using ClamSMTP
X-Original-Sender: magfr@lysator.liu.se
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of magfr@lysator.liu.se designates 2001:6b0:17:f0a0::3 as permitted
 sender) smtp.mail=magfr@lysator.liu.se
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:6208
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/6208>

On Fri, 2013-09-06 at 17:14 -0700, Richard Smith wrote:
> On Fri, Sep 6, 2013 at 4:48 PM, Vlad from Moscow <vlad.moscow@mail.ru>
> wrote:
>         I doi not agree that we need a new version of stack. All what
>         we need we already have. Moreover stack does not require
>         member function size(). It is unnecessary function. What is
>         size()? Inf act is is an analogy of an iterator. Consider
>         using size with an array something as
>          
>         for ( int i = 0; i < n; i++ ) a[i] = i;
>          
>         a + 0 and a + n give us iterators. However stack has no
>         iterators so it does not need the size() function. The logic
>         of functionality of the stack is simple. We are popping out
>         elements of the stack while it is not empty.
>          
>         What we need is simply a specialization of std::stack for
>         std::forward_list. std::forward_list has all functionality of
>         the stack.
> 
> 
> We risk introducing surprising behavior if we add support for this.
> Right now, std::stack::push adds elements to the *end* of the stack,
> and this is an observable property in various ways (for instance, due
> to the container member being protected rather than private). 

So, is a backward_list what is needed for Vlad's use case?

Please note that it would be a strange beast indeed as it won't support
insert(iterator, value), erase(iterator), begin() or end() (but rbegin()
and rend()). The forward_list proposal touches on this subject - mainly
by noting that it becomes an even odder container than forward_list.

/MF

-- 

--- 
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/.

.
