220 34976 <551eb493-f49d-412d-98d2-9a5d96f68104@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Aleksey Loginov <aleksey.loginov@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Idea about "std::pmr::memory_resource"
Date: Mon, 16 Oct 2017 23:22:07 -0700 (PDT)
Lines: 99
Approved: news@gmane.org
Message-ID: <551eb493-f49d-412d-98d2-9a5d96f68104@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>
 <bd58ac93-5d20-48e6-93cc-b07a727ce892@isocpp.org>
 <4af80cf7-244c-4137-9133-1a36a209e4ca@isocpp.org>
 <7f22751b-91d1-4de4-81d2-421046ceb963@isocpp.org>
 <68690e5c-f466-4fbe-ab41-80be58257259@isocpp.org>
 <664105b3-ea68-4565-8017-a4893f4b38bf@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_18673_2031292878.1508221327709"
X-Trace: blaine.gmane.org 1508221339 984 195.159.176.226 (17 Oct 2017 06:22:19 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 17 Oct 2017 06:22:19 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCGIDMXA5AJRBEGDS3HQKGQEVOYC6PQ@isocpp.org Tue Oct 17 08:22:14 2017
Return-path: <std-proposals+bncBCGIDMXA5AJRBEGDS3HQKGQEVOYC6PQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f71.google.com ([209.85.213.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCGIDMXA5AJRBEGDS3HQKGQEVOYC6PQ@isocpp.org>)
	id 1e4LGM-0006bF-If
	for gclcip-std-proposals@m.gmane.org; Tue, 17 Oct 2017 08:22:02 +0200
Original-Received: by mail-vk0-f71.google.com with SMTP id q13sf262824vkb.16
        for <gclcip-std-proposals@m.gmane.org>; Mon, 16 Oct 2017 23:22:10 -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=FBfEmobSh3162ya/a01R1kVqecFjOvPh3wTk+nvhAXo=;
        b=CpwRhPihg1ewzPByG0ToNekZyFx8LUsCtpn7b+HRiyCrqhh0iRqOK0TBObz+3OkHp2
         WyUWSzkSV/9/8u69g6pazU3SbaFe8/u/esSmZOP7Lte9iLcSoa10scYd7QXxsQ88+Amp
         DkTZYnKnZFec6emtKqQWO8DW8QYrYTxHVX7BmDbkcDHMXknPRWkRiNf/6BXrEKDTxmq3
         S9O3+nENT4ztyiOF6JwnnktAe5tVfMumZzvzhyJA6fk269vTeFdZ3CoR7xJjRRVjy+r3
         U3r2NNEG9MrtqofToXu3APhA9Di/+0zwqSLlC8MVjBZrLGnNIRQrQDe2wT8umU+C/dvT
         7jAQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        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=FBfEmobSh3162ya/a01R1kVqecFjOvPh3wTk+nvhAXo=;
        b=IzKFNjQFkv4nHB3Zd81vzuj9ebdILPzyzVtIV7uh5uxN2Ud3rfL7A0f2Ev6LoRQD0Q
         HDx1Bsi5zrbIGAYX+ityd1eOgEvU43UZQY23wNwnL+3xcnvbwWadS5z69j5PtzjOzh5k
         JTAVuC01abl3D0V0ju6k6UPYdbBqKt3G/EA/7GNhJbIcgVdp2nOnNCm3HlI6yuqDQcIA
         EWlPBeD1BQthSidJ2LzEDNmLe6V9SclcOR5b0ZD2a0R8Ur1O9UIMYOtoOya3bFmfLjXm
         uAONhmYPMwFbhOtd0IjsempwJjgMuppN53ruIwoA11J4nvPmKXitir6VYNOs1jfdlq3G
         JAHw==
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=FBfEmobSh3162ya/a01R1kVqecFjOvPh3wTk+nvhAXo=;
        b=j28GCbu+FnXqJhyQk/i/uuOCjkN8kJejwDJRpMZMaFGAR2KBKDswcZ75419y1toqu9
         qDlZBtddGsHr9pWeuL0WuI6xYk11ZKjEW1AKThahVnoW/LNAYrIbmwei4miwj/u1qBK+
         rkRgyteUClgBGbvUtJZM4eA+79pgmitIWKMUmkQIeBsZTeL6fGgcojX0iWO5V2GukwL/
         n1oKfVWhoKjw3DYmIV0/Fn4fa+YMJRcE0i6RGYM/dL6S0qtN+DFc2lI3Q/HHsjNHjAWo
         wyXTjsq6/JCpA0m/ULcxGJ8Vh/cb3/X4igmYL4ULpFd9EDsqRDZI6mQGk15+dcQjOd5V
         2low==
X-Gm-Message-State: AMCzsaXKvMM8CFBWWfNCejOVJ6jFtB+JlWznCHxLjz1snQBhRAPy0TY0
	6shqrZ+qieyNrc/5JR/wG/ezyQ==
X-Google-Smtp-Source: AOwi7QBay7DLcoeaqH2s8GFXzyGtC4objTt5GZpoXZmtUQ8F29MF5TeaVZQzqpnmoEt4JORGI2gADw==
X-Received: by 10.176.79.226 with SMTP id t34mr6289593uah.115.1508221329751;
        Mon, 16 Oct 2017 23:22:09 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.31.182.133 with SMTP id g127ls111529vkf.4.gmail; Mon, 16 Oct
 2017 23:22:08 -0700 (PDT)
X-Received: by 10.31.201.198 with SMTP id z189mr37579vkf.0.1508221328388;
        Mon, 16 Oct 2017 23:22:08 -0700 (PDT)
In-Reply-To: <664105b3-ea68-4565-8017-a4893f4b38bf@isocpp.org>
X-Original-Sender: Aleksey.Loginov@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: <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:34976
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34976>

------=_Part_18673_2031292878.1508221327709
Content-Type: multipart/alternative; 
	boundary="----=_Part_18674_46590738.1508221327709"

------=_Part_18674_46590738.1508221327709
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable


=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D0=B8=D0=BA, 17 =D0=BE=D0=BA=D1=82=D1=8F=D0=
=B1=D1=80=D1=8F 2017 =D0=B3., 4:29:15 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=
=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Mingxin Wang=20
=D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>
> On Tuesday, October 17, 2017 at 1:39:33 AM UTC+8, Aleksey Loginov wrote:
>>
>> In other words, by hand-made RTTI, and only for fixed allocation=20
>> starategies (for example, data_ can not be a shared_ptr<T> or cow_ptr<T>=
)
>>
>
> There is NO RTTI in the implementation of "operator=3D". This operation i=
s=20
> done via indirect function calls, and it is as efficient as most=20
> implementations of `std::any` from various vendors.
>
> `data_` is actually implementation detail, I don't know about your=20
> motivation that it should be shared_ptr<T> or cow_ptr<T>.
>
> Mingxin Wang
>

You are just simulate RTTI via function pointers and meta-type pointer (con=
st=20
manager_t*).

Motivation is simple: do not copy big data, when it's not needed. Passing=
=20
policy in constructor like in_place_type_t can do the job.

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/551eb493-f49d-412d-98d2-9a5d96f68104%40isocpp.or=
g.

------=_Part_18674_46590738.1508221327709
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br>=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D0=B8=D0=BA, 17 =D0=BE=
=D0=BA=D1=82=D1=8F=D0=B1=D1=80=D1=8F 2017 =D0=B3., 4:29:15 UTC+3 =D0=BF=D0=
=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Mingxin Wan=
g =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<blockquote class=3D"gmail_quo=
te" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddi=
ng-left: 1ex;"><div dir=3D"ltr">On Tuesday, October 17, 2017 at 1:39:33 AM =
UTC+8, Aleksey Loginov wrote:<blockquote class=3D"gmail_quote" style=3D"mar=
gin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div d=
ir=3D"ltr"><div>In other words, by hand-made RTTI, and only for fixed alloc=
ation starategies (for example, data_ can not be a shared_ptr&lt;T&gt; or c=
ow_ptr&lt;T&gt;)</div></div></blockquote><div><br></div><div>There is NO RT=
TI in the implementation of &quot;operator=3D&quot;. This operation is done=
 via indirect function calls, and it is as efficient as most implementation=
s of `std::any` from various vendors.</div><div><br></div><div>`data_` is a=
ctually implementation detail, I don&#39;t know about your motivation that =
it should be shared_ptr&lt;T&gt; or cow_ptr&lt;T&gt;.</div><div><br></div><=
div>Mingxin Wang</div></div></blockquote><div><br></div><div>You are just s=
imulate RTTI via function pointers and meta-type pointer (<span style=3D"ba=
ckground-color: rgb(250, 250, 250); color: rgb(102, 0, 102); font-family: m=
onospace;">const manager_t*</span>).</div><div><br></div><div>Motivation is=
 simple: do not copy big data, when it&#39;s not needed. Passing policy in =
constructor like=C2=A0<span style=3D"background-color: rgb(250, 250, 250); =
color: rgb(102, 0, 102); font-family: monospace;">in_place_type_t</span>=C2=
=A0can do the job.</div><div><br></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/551eb493-f49d-412d-98d2-9a5d96f68104%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/551eb493-f49d-412d-98d2-9a5d96f68104=
%40isocpp.org</a>.<br />

------=_Part_18674_46590738.1508221327709--

------=_Part_18673_2031292878.1508221327709--

.
