220 34958 <bb3ae52c-c3be-4966-a8d5-731b6f68919b@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 02:24:01 -0700 (PDT)
Lines: 114
Approved: news@gmane.org
Message-ID: <bb3ae52c-c3be-4966-a8d5-731b6f68919b@isocpp.org>
References: <0a8293b4-3246-47a5-9881-bc1ca4b91772@isocpp.org>
 <16a45cfa-8016-4f9d-8d6c-48d1e73c4874@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_17221_703955355.1508145841893"
X-Trace: blaine.gmane.org 1508145845 3157 195.159.176.226 (16 Oct 2017 09:24:05 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 16 Oct 2017 09:24:05 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDNMBNHJWIGBBMXVSHHQKGQE6L36C5Q@isocpp.org Mon Oct 16 11:23:59 2017
Return-path: <std-proposals+bncBDNMBNHJWIGBBMXVSHHQKGQE6L36C5Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f70.google.com ([209.85.213.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDNMBNHJWIGBBMXVSHHQKGQE6L36C5Q@isocpp.org>)
	id 1e41cq-0008CB-Ru
	for gclcip-std-proposals@m.gmane.org; Mon, 16 Oct 2017 11:23:57 +0200
Original-Received: by mail-vk0-f70.google.com with SMTP id 137sf5754924vkk.11
        for <gclcip-std-proposals@m.gmane.org>; Mon, 16 Oct 2017 02:24:04 -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=Bcgpc6EMk1cS5ia1AithyWF2zTcLurult1oxAnUuGak=;
        b=mUT/GKAGnAXFqwQizniAA+mvMvcFRIXb5Sm5hE4kgiMeMw6KdDEPzLg8OxZmWGKwC8
         vAO+j16qn6nDeBebpZk/17+iZ3zCXwiW9NSljD5GQPfoU6d7xALPF4NZ0EALG6motrCU
         iyEfOq9RKGdXQDjvX4B2XyR0vXCPIWQAXAVN7gX/cSJ1TND2J+gVMQ1bZPjBksyJAecc
         RM6s9NII80C8iRNsu4QpPTI6bkPqEVffkH/cMwfRpi0/BWn8EReIo4fhrkORPcjzRmmP
         fgcmtuFade9kWjSVwkDk1bMFYnMQ4cwhhNlq5n1aRCzCmq/hQb9FCtnsFKNma5ggsyeo
         a5Nw==
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=Bcgpc6EMk1cS5ia1AithyWF2zTcLurult1oxAnUuGak=;
        b=eg7nZb4yOv6zKhRXjRqw7mb8ioAcfoGy6jjjcMNlByICJm0mFBBWPCzt+8SqeHKXdP
         Pc+EWchxPOQWeYqZ3kjBcwCta2G5yR6m/NMW317xxNbJbYs/o/f4fpZE/XAoIz2b4WYI
         9qYPbMVRCp+Y8lslkh2idTfODmaKAF/pNLL2Jtay0dhl0ZN40GcAhSWXF8IPlCFguu1A
         pEssAmBGTg5xEwI/FUXkZsjFqO5Ux32/kY5I1TbuOEj6YTeWD6uJUGyAlAHPn+wKtIWU
         /jp78F8e1uVOdDZherW6xzLOjCmIc4mr+if/WpCVeLgaEA+8OOe+YyvnJ7PeEU8mXaBD
         3v+Q==
X-Gm-Message-State: AMCzsaWUJtinE8CAz9IyS2HbPusxeVMTrjhcRbOzks0jZhYgetlL7/nk
	4Jsfi+Eb1Z9fHZoTw2pQ+za51A==
X-Google-Smtp-Source: AOwi7QDTgpIaVSz7NnZd27IpL6krV+TOJrGpUdp9EMf/Y1W3vMP1Ih6TlgjdxP/Uhc8MGTCEUIj3+w==
X-Received: by 10.31.124.136 with SMTP id x130mr4795629vkc.44.1508145843996;
        Mon, 16 Oct 2017 02:24:03 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.31.67.200 with SMTP id q191ls2971178vka.7.gmail; Mon, 16 Oct
 2017 02:24:02 -0700 (PDT)
X-Received: by 10.31.168.133 with SMTP id r127mr359544vke.8.1508145842587;
        Mon, 16 Oct 2017 02:24:02 -0700 (PDT)
In-Reply-To: <16a45cfa-8016-4f9d-8d6c-48d1e73c4874@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:34958
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34958>

------=_Part_17221_703955355.1508145841893
Content-Type: multipart/alternative; 
	boundary="----=_Part_17222_149021227.1508145841893"

------=_Part_17222_149021227.1508145841893
Content-Type: text/plain; charset="UTF-8"

On Monday, October 16, 2017 at 6:04:26 AM UTC+8, Arthur O'Dwyer wrote:
>
> What you are describing has already been implemented (and proposed, 
> AFAIK). It is an excellent idea. I don't know why it didn't get into C++17 
> along with all the other pieces of PMR that did.
> http://en.cppreference.com/w/cpp/experimental/resource_adaptor 
> <http://www.google.com/url?q=http%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Fexperimental%2Fresource_adaptor&sa=D&sntz=1&usg=AFQjCNGbUH6FrHld29Itv0z9YvGaubul7Q>
>

`std::experimental::pmr::resource_adaptor` seems not what I have suggested. 
I think "MemoryResource" has lower level semantics (provides more basic 
service) than "Allocator" does, and therefore "Allocator" could be 
"MemoryResource"'s user. On the contrary, defining a basic service with an 
advanced one seems logically unreasonable, so I do not suggest 
`std::experimental::pmr::resource_adaptor` should be included in the 
standard.

However, PMR will never be all things to all people. You should certainly 
> read my paper P0773R0 "Towards Meaningful Fancy Pointers" 
> <http://quuxplusone.github.io/draft/fancy-pointers.html> in the upcoming 
> pre-Albuquerque mailing; it will clarify your thinking about "what is an 
> allocator" and especially "what does allocator equality mean"; and it will 
> make you much more pessimistic about the chances of shoehorning the full 
> C++11 allocator model (including fancy pointer types) into type-erased 
> things like polymorphic_allocator, function, and any.
>

Thank you for the paper! However, I am targeting at neither "Allocator" nor 
"the full C++11 allocator model". The target in this discussion is the PMR 
system.

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/bb3ae52c-c3be-4966-a8d5-731b6f68919b%40isocpp.org.

------=_Part_17222_149021227.1508145841893
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, October 16, 2017 at 6:04:26 AM UTC+8, Arthur O&=
#39;Dwyer wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r"><div>What you are describing has already been implemented (and proposed,=
 AFAIK). It is an excellent idea. I don&#39;t know why it didn&#39;t get in=
to C++17 along with all the other pieces of PMR that did.</div><div><a href=
=3D"http://www.google.com/url?q=3Dhttp%3A%2F%2Fen.cppreference.com%2Fw%2Fcp=
p%2Fexperimental%2Fresource_adaptor&amp;sa=3DD&amp;sntz=3D1&amp;usg=3DAFQjC=
NGbUH6FrHld29Itv0z9YvGaubul7Q" target=3D"_blank" rel=3D"nofollow" onmousedo=
wn=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fen.cppre=
ference.com%2Fw%2Fcpp%2Fexperimental%2Fresource_adaptor\x26sa\x3dD\x26sntz\=
x3d1\x26usg\x3dAFQjCNGbUH6FrHld29Itv0z9YvGaubul7Q&#39;;return true;" onclic=
k=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fen.cppref=
erence.com%2Fw%2Fcpp%2Fexperimental%2Fresource_adaptor\x26sa\x3dD\x26sntz\x=
3d1\x26usg\x3dAFQjCNGbUH6FrHld29Itv0z9YvGaubul7Q&#39;;return true;">http://=
en.cppreference.com/w/<wbr>cpp/experimental/resource_<wbr>adaptor</a></div>=
</div></blockquote><div><br></div><div>`std::experimental::pmr::resource_ad=
aptor` seems not what I have suggested. I think &quot;MemoryResource&quot; =
has lower level semantics (provides more basic service) than &quot;Allocato=
r&quot; does, and therefore &quot;Allocator&quot; could be &quot;MemoryReso=
urce&quot;&#39;s user.=C2=A0On the contrary, defining a basic service with =
an advanced one seems logically unreasonable, so I do not suggest `std::exp=
erimental::pmr::resource_adaptor` should be included in the standard.</div>=
<div><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr=
"><div></div><div>However, PMR will never be all things to all people. You =
should certainly read my paper <a href=3D"http://quuxplusone.github.io/draf=
t/fancy-pointers.html" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"th=
is.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fquuxplusone.gith=
ub.io%2Fdraft%2Ffancy-pointers.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjC=
NG9dMxYs0pZIaVi7Y_jMB93rhtHew&#39;;return true;" onclick=3D"this.href=3D&#3=
9;http://www.google.com/url?q\x3dhttp%3A%2F%2Fquuxplusone.github.io%2Fdraft=
%2Ffancy-pointers.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG9dMxYs0pZIa=
Vi7Y_jMB93rhtHew&#39;;return true;">P0773R0 &quot;Towards Meaningful Fancy =
Pointers&quot;</a> in the upcoming pre-Albuquerque mailing; it will clarify=
 your thinking about &quot;what is an allocator&quot; and especially &quot;=
what does allocator equality mean&quot;; and it will make you much more pes=
simistic about the chances of shoehorning the full C++11 allocator model (i=
ncluding fancy pointer types) into type-erased things like polymorphic_allo=
cator, function, and any.</div></div></blockquote><div><br></div><div>Thank=
 you for the paper! However, I am targeting at neither &quot;Allocator&quot=
; nor &quot;the full C++11 allocator model&quot;. The target in this discus=
sion is the PMR system.</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/bb3ae52c-c3be-4966-a8d5-731b6f68919b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/bb3ae52c-c3be-4966-a8d5-731b6f68919b=
%40isocpp.org</a>.<br />

------=_Part_17222_149021227.1508145841893--

------=_Part_17221_703955355.1508145841893--

.
