220 20331 <55EEFB75.6010808@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Andrey Semashev <andrey.semashev@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: [N3916] Using memory resources in global constructors/destructors
Date: Tue, 8 Sep 2015 18:15:01 +0300
Lines: 23
Approved: news@gmane.org
Message-ID: <55EEFB75.6010808@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Trace: ger.gmane.org 1441725353 9146 80.91.229.3 (8 Sep 2015 15:15:53 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 8 Sep 2015 15:15:53 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCXY5TXHWYJRBFHXXOXQKGQELNISYCI@isocpp.org Tue Sep 08 17:15:48 2015
Return-path: <std-proposals+bncBCXY5TXHWYJRBFHXXOXQKGQELNISYCI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f200.google.com ([209.85.217.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCXY5TXHWYJRBFHXXOXQKGQELNISYCI@isocpp.org>)
	id 1ZZKcP-0002PM-Rd
	for gclcip-std-proposals@m.gmane.org; Tue, 08 Sep 2015 17:15:33 +0200
Original-Received: by lbbmp1 with SMTP id mp1sf37261040lbb.2
        for <gclcip-std-proposals@m.gmane.org>; Tue, 08 Sep 2015 08:15:33 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:message-id:date:user-agent
         :mime-version:content-type:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=6WYH4m1wiqu9j65sJLxe6f9Q3aXddPCkcxYsUmhGSq4=;
        b=KuDFTKmugzkijWfqzbhN7p1948nsRsCMKEzrICodqkdjVriJJfyw1oC5qMK6c4rF7s
         V4AxtHhlusrXy0RIqAYyqRmNcUhMToErbLbW5g7WU/tKx+0A/qf1YtGV9ILgUL+6oI88
         6MzDbjLZINp9b1+QYu+pCiwIdbnu3et19AgkpHlykKOQi+jqCMdL9e5H/9Zi5J6hL2cK
         21dmGuNb/REsHiRQmv/uHZuftDXpNdjNxkX74Cj7WF6Ic6J4sOVeFuep0nhuNyv++961
         XKXDdQcKtCEvGONcxphRKlJO4m63eCetCNI9yxNK41OjPhbjGOy9tCI03ZW2xFC+iwvP
         hHCQ==
X-Gm-Message-State: ALoCoQk1qwR8GkcbQWcpUUV24eOCr3E1xdhCWk7AIL+ZVm5L5jQAtJPFEQCfJNpirUe8Tw7x2UbV
X-Received: by 10.180.87.199 with SMTP id ba7mr6825442wib.5.1441725333762;
        Tue, 08 Sep 2015 08:15:33 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.37.72 with SMTP id w8ls738669laj.7.gmail; Tue, 08 Sep 2015
 08:15:30 -0700 (PDT)
X-Received: by 10.152.5.68 with SMTP id q4mr23162597laq.66.1441725330131;
        Tue, 08 Sep 2015 08:15:30 -0700 (PDT)
Original-Received: from mail-la0-x235.google.com (mail-la0-x235.google.com. [2a00:1450:4010:c03::235])
        by mx.google.com with ESMTPS id zx2si3505390lbb.82.2015.09.08.08.15.30
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 08 Sep 2015 08:15:30 -0700 (PDT)
Received-SPF: pass (google.com: domain of andrey.semashev@gmail.com designates 2a00:1450:4010:c03::235 as permitted sender) client-ip=2a00:1450:4010:c03::235;
Original-Received: by lagj9 with SMTP id j9so72251163lag.2
        for <std-proposals@isocpp.org>; Tue, 08 Sep 2015 08:15:29 -0700 (PDT)
X-Received: by 10.112.218.5 with SMTP id pc5mr22968977lbc.97.1441725329570;
        Tue, 08 Sep 2015 08:15:29 -0700 (PDT)
Original-Received: from [192.168.1.2] (broadband-178-140-129-233.nationalcablenetworks.ru. [178.140.129.233])
        by smtp.googlemail.com with ESMTPSA id li7sm1005454lab.25.2015.09.08.08.15.28
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 08 Sep 2015 08:15:29 -0700 (PDT)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.2.0
X-Original-Sender: andrey.semashev@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of andrey.semashev@gmail.com designates 2a00:1450:4010:c03::235 as
 permitted sender) smtp.mailfrom=andrey.semashev@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-Spam-Checked-In-Group: 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: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:20331
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/20331>

Hi,

In N3916, "Polymorphic Memory Resources, r2", it is said that 
new_delete_resource() and null_memory_resource() return pointers to the 
memory resource objects which have statis storage duration. Since these 
objects derive from memory_resource and have virtual functions, these 
objects are initialized at dynamic initialization stage and as such 
cannot be used in global constructors and destructors. Is my 
understanding correct?

If so, I think this is a serious limitation that severily hampers 
usability of this mechanism. It is quite common to have global strings 
and containers (directly or as part of user-defined types), which had 
been safe before.

-- 

--- 
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/.

.
