220 11525 <CAGZEXt2VVVS13nbffBeTfUr0boU9XJwgm0z81-cd2G_DmfL8Ag@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Alex <alex.shtf@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Add support for move-only types in std::priority_queue
Date: Thu, 19 Jun 2014 11:36:27 +0300
Lines: 127
Approved: news@gmane.org
Message-ID: <CAGZEXt2VVVS13nbffBeTfUr0boU9XJwgm0z81-cd2G_DmfL8Ag@mail.gmail.com>
References: <2fff5775-3cb1-433f-b01f-8018a65eec82@isocpp.org>
	<CAGg_6+Mho5iG4ExrPgK15PDhfvvboHGMHbnpekC=fw8UJjwo4A@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7b2e54b8d46de304fc2c453a
X-Trace: ger.gmane.org 1403166996 15242 80.91.229.3 (19 Jun 2014 08:36:36 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 19 Jun 2014 08:36:36 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDOZJQ42YMARBC6CRKOQKGQEFVTHYXQ@isocpp.org Thu Jun 19 10:36:29 2014
Return-path: <std-proposals+bncBDOZJQ42YMARBC6CRKOQKGQEFVTHYXQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f198.google.com ([209.85.213.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDOZJQ42YMARBC6CRKOQKGQEFVTHYXQ@isocpp.org>)
	id 1WxXpd-0003QA-1g
	for gclcip-std-proposals@m.gmane.org; Thu, 19 Jun 2014 10:36:29 +0200
Original-Received: by mail-ig0-f198.google.com with SMTP id h3sf7301753igd.9
        for <gclcip-std-proposals@m.gmane.org>; Thu, 19 Jun 2014 01:36:28 -0700 (PDT)
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=LGOXSZNtNKJ95hhPF11NEpGyXHnH1fq+4aygvnGlVqo=;
        b=mwo5V+OXQqRfIv2XvrHhVD4st3KTeSGEt4Fv5tblv3NhdJA/27RzZbWU35dXDdKtv6
         7Uypg5jC6/qfNv7Ctn9uSUaEqu01YTLQgLJ74ADb9vD9z30ye24mSbjUFj7wb3e83H6E
         I7VYOQgtMoPLlTkccl3vZb0oADPve8Cu8f4jIWVt+/8y0MploISQN6o4k5qRTZ05LFaL
         0zcM9CchTeSgh+EO1kQLzHooUK3yBehNQ+hkaV2uchZTcQ1vIeqIfRibviJf94o0hq01
         IuEPuwzJQIAjVq2RyT+oo0Jbf4D4AYxgmNHB0FHYD68BH2zNzXgpywVBJT2V8GzUEcea
         IhRg==
X-Gm-Message-State: ALoCoQkHGpmFxRVDfET1vKxAl8wbeNOBu6ynDegPdTdDDbUte/Ad9D3xam9c8ZqpYs/LKAuwBwRz
X-Received: by 10.182.128.166 with SMTP id np6mr1850426obb.16.1403166987978;
        Thu, 19 Jun 2014 01:36:27 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.40.74 with SMTP id w68ls466624qgw.53.gmail; Thu, 19 Jun
 2014 01:36:27 -0700 (PDT)
X-Received: by 10.58.208.228 with SMTP id mh4mr2889754vec.22.1403166987322;
        Thu, 19 Jun 2014 01:36:27 -0700 (PDT)
Original-Received: from mail-vc0-x231.google.com (mail-vc0-x231.google.com [2607:f8b0:400c:c03::231])
        by mx.google.com with ESMTPS id ht8si2041235vdb.61.2014.06.19.01.36.27
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 19 Jun 2014 01:36:27 -0700 (PDT)
Received-SPF: pass (google.com: domain of alex.shtf@gmail.com designates 2607:f8b0:400c:c03::231 as permitted sender) client-ip=2607:f8b0:400c:c03::231;
Original-Received: by mail-vc0-f177.google.com with SMTP id ij19so1910191vcb.36
        for <std-proposals@isocpp.org>; Thu, 19 Jun 2014 01:36:27 -0700 (PDT)
X-Received: by 10.58.122.138 with SMTP id ls10mr2918808veb.13.1403166987150;
 Thu, 19 Jun 2014 01:36:27 -0700 (PDT)
Original-Received: by 10.58.199.81 with HTTP; Thu, 19 Jun 2014 01:36:27 -0700 (PDT)
In-Reply-To: <CAGg_6+Mho5iG4ExrPgK15PDhfvvboHGMHbnpekC=fw8UJjwo4A@mail.gmail.com>
X-Original-Sender: alex.shtf@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of alex.shtf@gmail.com designates 2607:f8b0:400c:c03::231 as permitted
 sender) smtp.mail=alex.shtf@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:11525
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11525>

--047d7b2e54b8d46de304fc2c453a
Content-Type: text/plain; charset=UTF-8

You mean that the pop_back() of the adapted container throws? I believe
that the item is lost.
But I believe that priority_queue cannot promise much anyway when
exceptions are thrown. For example, what happens if the comparison function
throws? The heap-order is not preserved and the user cannot rely on the
contents of the priority_queue.


On Thu, Jun 19, 2014 at 10:49 AM, Nevin Liber <nevin@eviloverlord.com>
wrote:

> On 19 June 2014 09:46, <alex.shtf@gmail.com> wrote:
>
>> Currently there is no clean way use move-only types in
>> std::priority_queue. The top() function returns a const-reference and the
>> pop() function does not return anything.
>> I suggest adding a function, extract_top() that is equivalent to pop()
>> except that it also returns the element that was at the top.
>>
>
> What should happen if an exception is thrown?
> --
>  Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/a/isocpp.org/d/topic/std-proposals/AQ2bJxtT_4g/unsubscribe
> .
> To unsubscribe from this group and all its topics, 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/.
>

-- 

--- 
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/.

--047d7b2e54b8d46de304fc2c453a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:verdana,=
sans-serif">You mean that the pop_back() of the adapted container throws? I=
 believe that the item is lost.<br>But I believe that priority_queue cannot=
 promise much anyway when exceptions are thrown. For example, what happens =
if the comparison function throws? The heap-order is not preserved and the =
user cannot rely on the contents of the priority_queue.<br>
</div></div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">O=
n Thu, Jun 19, 2014 at 10:49 AM, Nevin Liber <span dir=3D"ltr">&lt;<a href=
=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com=
</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"">On 19 June =
2014 09:46,  <span dir=3D"ltr">&lt;<a href=3D"mailto:alex.shtf@gmail.com" t=
arget=3D"_blank">alex.shtf@gmail.com</a>&gt;</span> wrote:<br>
</div><div class=3D"gmail_extra"><div class=3D"gmail_quote"><div class=3D""=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex">

<div dir=3D"ltr">Currently there is no clean way use move-only types in std=
::priority_queue. The top() function returns a const-reference and the pop(=
) function does not return anything.<br>I suggest adding a function, extrac=
t_top() that is equivalent to pop() except that it also returns the element=
 that was at the top.<br>


</div></blockquote><div><br></div></div><div>What should happen if an excep=
tion is thrown?</div></div><span class=3D"HOEnZb"><font color=3D"#888888">-=
- <br>=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=3D"mailto:=
nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>&gt;=C2=
=A0 <a href=3D"tel:%28847%29%20691-1404" value=3D"+18476911404" target=3D"_=
blank">(847) 691-1404</a>
</font></span></div></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to a topic in the Goog=
le Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this topic, visit <a href=3D"https://groups.google.com/=
a/isocpp.org/d/topic/std-proposals/AQ2bJxtT_4g/unsubscribe" target=3D"_blan=
k">https://groups.google.com/a/isocpp.org/d/topic/std-proposals/AQ2bJxtT_4g=
/unsubscribe</a>.<br>

To unsubscribe from this group and all its topics, send an email to <a href=
=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-prop=
osals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></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 />

--047d7b2e54b8d46de304fc2c453a--

.
