220 34961 <72ef3209-6749-4246-9c5a-1549557ceb5a@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Mingxin Wang <wmx16835vv@163.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Idea about "std::pmr::memory_resource"
Date: Mon, 16 Oct 2017 04:55:41 -0700 (PDT)
Lines: 117
Approved: news@gmane.org
Message-ID: <72ef3209-6749-4246-9c5a-1549557ceb5a@isocpp.org>
References: <0a8293b4-3246-47a5-9881-bc1ca4b91772@isocpp.org>
 <07ddb1f6-d3af-43df-bf96-8975c1ab4313@isocpp.org>
 <2e191a96-1952-479b-b78b-22e31f8e03de@isocpp.org>
 <0e37b5ae-64f6-4a8a-86bd-f44b119ed40a@isocpp.org>
 <15f8c5ba-3a6a-4441-9620-92e157c66094@isocpp.org>
 <26fe4cb4-98ca-41cc-ac96-5c51851799d1@isocpp.org>
 <fee0a310-5dc5-4421-bf49-bc8fa164fe29@isocpp.org>
 <784ffce8-ace7-449d-a13d-a99d7336117a@isocpp.org>
 <d029c18a-12ee-4a7d-828c-ab1bd07b58c6@isocpp.org>
 <6d0ad98b-87d5-43dd-ac54-2b7d3e03e31b@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_17448_1378561949.1508154941561"
X-Trace: blaine.gmane.org 1508154956 27062 195.159.176.226 (16 Oct 2017 11:55:56 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 16 Oct 2017 11:55:56 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDNMBNHJWIGBBPV4SLHQKGQEOD6UD4A@isocpp.org Mon Oct 16 13:55:52 2017
Return-path: <std-proposals+bncBDNMBNHJWIGBBPV4SLHQKGQEOD6UD4A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f198.google.com ([209.85.217.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDNMBNHJWIGBBPV4SLHQKGQEOD6UD4A@isocpp.org>)
	id 1e43zc-0004gx-AP
	for gclcip-std-proposals@m.gmane.org; Mon, 16 Oct 2017 13:55:36 +0200
Original-Received: by mail-ua0-f198.google.com with SMTP id e46sf7557518uaa.6
        for <gclcip-std-proposals@m.gmane.org>; Mon, 16 Oct 2017 04:55:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=TOxurWqObPZ1y9ccqZwA68CmdSh3renfLckENoWDA7U=;
        b=b7v97dLKSSh59e/PrndfXlHCmnqLOWCbMjauYQQOloIg/B2JRiSyM/S7jmTZ7iKiap
         mALjeroJsjGBbMkPGNCj0H5YDLRa0ynIObct0okJhWBUMevJNtHq+kTOTWdAe+qnPhKr
         YO0jltFdNjU6MJiO/ea6ko+LAgnA16j9yPuF3yQgDbkZrbKG3MINf/fcgxQPzSFh6R+y
         fREv160NsVMzeE5357UB30ZhvRbs1O6Oj7AYdf35AAK2u9dL8cJdmoF6PZrFhbZ1WJKs
         VSsnNzYsmDd3aW2mUkIYVvUzUqOii/XO9W9ldvjVPZMLumCdfq01/gQm2QmUNpcNBfR4
         2xQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=TOxurWqObPZ1y9ccqZwA68CmdSh3renfLckENoWDA7U=;
        b=IXNe8X90yIv3Q2WRMrodHXBWjp4xOglJK7F2NbkyVmBsHmoSNwg5zyYEirXk1tx37N
         mL9+gANL/06UbHv8BcIoohEZOup9BgayGichThXiP8pq7DDDXKKhLYnNcAQNdwV9upUl
         NpGvxiz3KUrh6gv4ChYaTlrfnzPEIwzKAhmhfnEt9NPHgscVMpRqqXOa/CNn/MqlF8Fn
         QCA8Q//r/XlJPb+fs7whImapb5JXZzqoQ5B5NFB56r3QuskLZF6TNQLJybO0MU/YTCRV
         51cZYkX/JQRQYc61yvITQ3UqH5Fw10i5E0yZSzfIOTi9bMGXSZgIjmRwxB1D38Wvp640
         fKzQ==
X-Gm-Message-State: AMCzsaUO7eNbNRzHoILTvgMSWl8MFJkR8grt2N6cmOO06KU8z3K2mC8x
	s3RniEPJuTY1wLNSZR6CeHuQDA==
X-Google-Smtp-Source: AOwi7QCLV9nu/KMaQraUFq/RWjtZCNZAIJ/gxzYV7AgVKpt+wkHnzNEvmvfsRicZyUv16JMJJ7MkCw==
X-Received: by 10.176.17.201 with SMTP id q9mr5099719uac.109.1508154943444;
        Mon, 16 Oct 2017 04:55:43 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.159.56.51 with SMTP id p48ls1526294uad.9.gmail; Mon, 16 Oct
 2017 04:55:42 -0700 (PDT)
X-Received: by 10.31.168.133 with SMTP id r127mr390271vke.8.1508154942156;
        Mon, 16 Oct 2017 04:55:42 -0700 (PDT)
In-Reply-To: <6d0ad98b-87d5-43dd-ac54-2b7d3e03e31b@isocpp.org>
X-Original-Sender: wmx16835vv@163.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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:34961
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34961>

------=_Part_17448_1378561949.1508154941561
Content-Type: multipart/alternative; 
	boundary="----=_Part_17449_7965529.1508154941562"

------=_Part_17449_7965529.1508154941562
Content-Type: text/plain; charset="UTF-8"

On Monday, October 16, 2017 at 6:55:41 PM UTC+8, Aleksey Loginov wrote:

> Let's look at a more applied example:
>
> template<size_t Size> 
> struct static_resource : memory_resource { aligned_storage_t<Size> m_data; 
> };
>
> template<typename MR>
> struct my_any;
>
>
> my_any<default_memory_resource> x1;
> my_any<static_resource<32>> x2;
>
> x1 = 1;
> x2 = x1;
>
> assert(x2 == 1);
>
>
> How can you do this without RTTI?
>

What is the semantics of `x2 == 1`? There is no definition about 
`operation==(...)` in the class `std::any`, and this expression is 
ill-formed if `x2` is a value of `std::any`. Do you mean that 
`any::operator==(const any&)` shall be added to the standard? If so, I 
suggest that you should illustrate your motivation and provide reasonable 
semantics.

Mingxin Wang

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/72ef3209-6749-4246-9c5a-1549557ceb5a%40isocpp.org.

------=_Part_17449_7965529.1508154941562
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, October 16, 2017 at 6:55:41 PM UTC+8, Aleksey L=
oginov wrote:<div><blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr"><div>Let&#39;s look at a more applied example:</div><div><br></div><di=
v><div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,=
187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><=
span style=3D"color:#008">template</span><span style=3D"color:#660">&lt;</s=
pan><span style=3D"color:#000">size_t </span><span style=3D"color:#606">Siz=
e</span><span style=3D"color:#660">&gt;</span><span style=3D"color:#000"> <=
br></span><span style=3D"color:#008">struct</span><span style=3D"color:#000=
"> static_resource </span><span style=3D"color:#660">:</span><span style=3D=
"color:#000"> </span><span style=3D"color:rgb(34,34,34)"><span style=3D"col=
or:#000">memory_resource </span><span style=3D"color:#660">{</span><span st=
yle=3D"color:#000"> </span></span><span style=3D"color:rgb(0,0,0);font-fami=
ly:DejaVuSansMono,&quot;DejaVu Sans Mono&quot;,courier,monospace;font-size:=
12.8px;white-space:nowrap;background-color:rgb(255,255,255)"><span style=3D=
"color:#000">aligned_storage_t</span><span style=3D"color:#660">&lt;</span>=
</span><span style=3D"color:rgb(102,0,102);font-family:Arial,Helvetica,sans=
-serif">Size</span><span style=3D"color:rgb(0,0,0);font-family:DejaVuSansMo=
no,&quot;DejaVu Sans Mono&quot;,courier,monospace;font-size:12.8px;white-sp=
ace:nowrap;background-color:rgb(255,255,255)"><span style=3D"color:#660">&g=
t;</span></span><span style=3D"font-family:Arial,Helvetica,sans-serif"><spa=
n style=3D"color:#000"> m_data</span><span style=3D"color:#660">;</span><sp=
an style=3D"color:#000"> </span><span style=3D"color:#660">};</span></span>=
</div><div><span style=3D"color:#000"><br></span><span style=3D"color:#008"=
>template</span><span style=3D"color:#660">&lt;</span><span><font color=3D"=
#000000">typename MR</font></span><span style=3D"color:#660">&gt;</span><sp=
an style=3D"color:#000"><br></span><span style=3D"color:#008">struct</span>=
<span style=3D"color:#000">=C2=A0my_any;<br><br><br>my_any&lt;default_</spa=
n><span style=3D"color:rgb(0,0,0)">memory_resource</span><span style=3D"col=
or:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif"><wbr>&gt; x1;</span><=
/div><div><span style=3D"color:#000"><span>my_any&lt;</span><span style=3D"=
font-family:Arial,Helvetica,sans-serif">static_resource&lt;32&gt;</span><sp=
an style=3D"font-family:Arial,Helvetica,sans-serif">&gt; x2;</span><br><br>=
<span style=3D"font-family:Arial,Helvetica,sans-serif">x1 =3D 1;<br>x2 =3D =
x1;<br></span><br>assert(</span><span style=3D"color:rgb(0,0,0);font-family=
:Arial,Helvetica,sans-serif">x2 =3D=3D 1</span><span style=3D"color:rgb(0,0=
,0);font-family:Arial,Helvetica,sans-serif">);</span></div><div><span style=
=3D"color:#000"><br></span></div></code></div><br></div><div>How can you=C2=
=A0do this without RTTI?</div></div></blockquote><div><br></div></div><div>=
What is the semantics of `x2 =3D=3D 1`? There is no definition about `opera=
tion=3D=3D(...)` in the class `std::any`, and this expression is ill-formed=
 if `x2` is a value of `std::any`. Do you mean that `any::operator=3D=3D(co=
nst any&amp;)` shall be added to the standard? If so, I suggest that you sh=
ould illustrate your motivation and provide reasonable semantics.</div><div=
><br></div><div>Mingxin Wang</div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/72ef3209-6749-4246-9c5a-1549557ceb5a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/72ef3209-6749-4246-9c5a-1549557ceb5a=
%40isocpp.org</a>.<br />

------=_Part_17449_7965529.1508154941562--

------=_Part_17448_1378561949.1508154941561--

.
