220 26907 <1cd5895f-df27-9cda-73cf-cbc2f1488a2c@f2.dion.ne.jp> article
Path: news.gmane.org!not-for-mail
From: Kazutoshi Satoda <k_satoda@f2.dion.ne.jp>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Better name for std::launder() ?
Date: Thu, 14 Jul 2016 03:24:55 +0900
Lines: 39
Approved: news@gmane.org
Message-ID: <1cd5895f-df27-9cda-73cf-cbc2f1488a2c@f2.dion.ne.jp>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1468434319 17464 80.91.229.3 (13 Jul 2016 18:25:19 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 13 Jul 2016 18:25:19 +0000 (UTC)
To: std-proposals@isocpp.org, richard@metafoo.co.uk
Original-X-From: std-proposals+bncBDIYVAE3UECRBA4PTK6AKGQE3HBUVKQ@isocpp.org Wed Jul 13 20:25:10 2016
Return-path: <std-proposals+bncBDIYVAE3UECRBA4PTK6AKGQE3HBUVKQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f197.google.com ([209.85.223.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDIYVAE3UECRBA4PTK6AKGQE3HBUVKQ@isocpp.org>)
	id 1bNOqL-0003U0-C2
	for gclcip-std-proposals@m.gmane.org; Wed, 13 Jul 2016 20:25:09 +0200
Original-Received: by mail-io0-f197.google.com with SMTP id r71sf109831546ioi.3
        for <gclcip-std-proposals@m.gmane.org>; Wed, 13 Jul 2016 11:25:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=to:from:subject:message-id:date:user-agent:mime-version
         :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=wFN4vLrwFOgJtvkhN6XNPHIEaSvtM/i54URS/BCLCmg=;
        b=FMOMp02AVFUd/CR9v9vARZHnix3chq6sFkDIAv+Lz+aiRo7K2ymWnlC0zndZ+quzaE
         +dTbpJT24CMkLyZTiPvgOkrE6GgD8n3B8XUD7hiRQNSdgUgWvgB677zMDeqRn+QK6VTU
         hQhhAkVVWpHr83rlIpSvRD0ekHNKOaohl+el7zOIeUbsk/hw8gt07ALB4MOyxINah+o0
         LLpC00UeCJIDVZs5I+YblAG3c2O/RCtkulXOmwKPNKPL9BKXO8Amscj0/+NMjJsVQQPQ
         bLMX/JECYkExQvcRhtb8MtGPxhJefZFoYN3ns4BKlsvf7aHITEC+03L5EKi5WZeoZK/i
         nCXQ==
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: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=wFN4vLrwFOgJtvkhN6XNPHIEaSvtM/i54URS/BCLCmg=;
        b=h4namXZO6mfwt0etpzcvRfJiIsDVnDwfySzVig1Atz90XkV3GdFoj0TbWqX98QGl9d
         LGlyltiXXNug3s3CqXbeABeA2+/jEEkkkrNOOgSeiXf7H3D/1mh9ndphkUxZmjh16KwK
         anIvhXRSNzJjzJqt+qwJ2m/RJjP3rbaroc/MMI6j3oq9JV8iAUjJD9XseiUxubOoKPro
         9NrcAtGTCi7UYQXJ0uepfExfgrnu0Jk/l/rbiUdHbcQFyGwGFAmlcewoC70CAV82bPfH
         DH1uiDc5IVhtPLtkM6RVgCgIpBoAoqy9lMwqIXmQDC2740FIWNomUST9qiXdUJmxWNNf
         kzlw==
X-Gm-Message-State: ALyK8tIHtF7tn+RGW6oAzWLnOyELQMa3xcjDj5IXzMpUeqxErKC1nS8HB0jc1pNg2xocYw==
X-Received: by 10.36.110.18 with SMTP id w18mr7783676itc.9.1468434308220;
        Wed, 13 Jul 2016 11:25:08 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.59.78 with SMTP id i75ls410562ioa.28.gmail; Wed, 13 Jul
 2016 11:25:07 -0700 (PDT)
X-Received: by 10.98.158.218 with SMTP id f87mr5741587pfk.121.1468434307177;
        Wed, 13 Jul 2016 11:25:07 -0700 (PDT)
Original-Received: from dmta02.auone-net.jp (mail-ae0-f53.auone-net.jp. [106.187.230.53])
        by mx.google.com with ESMTP id d81si5127592pfb.192.2016.07.13.11.25.06
        for <std-proposals@isocpp.org>;
        Wed, 13 Jul 2016 11:25:07 -0700 (PDT)
Received-SPF: pass (google.com: domain of k_satoda@f2.dion.ne.jp designates 106.187.230.53 as permitted sender) client-ip=106.187.230.53;
Original-Received: from amlmta046.auone-net.jp (amlmta046-MM [10.188.23.37])
	by dmta02.auone-net.jp (au one net mail) with ESMTP id 283B040007B
	for <std-proposals@isocpp.org>; Thu, 14 Jul 2016 03:25:06 +0900 (JST)
Original-Received: from [0.0.0.0] ([65.19.167.131])
	by amlmta046.auone-net.jp id 5786877f0004a6a500005e820000137a4000052f8e5b;
	Thu, 14 Jul 2016 03:25:03 +0900
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.2.0
X-MXM-DELIVERY-TYPE: 3
X-Original-Sender: k_satoda@f2.dion.ne.jp
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of k_satoda@f2.dion.ne.jp designates 106.187.230.53 as permitted
 sender) smtp.mailfrom=k_satoda@f2.dion.ne.jp
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: <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:26907
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26907>

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0137r0.html
(accepted for C++17)

The name std::launder() seems cryptic. There is no hint in the word
"launder" to show it is about the C++ object model, lifetime, and
reusing storage. The situation is likely same even if a programmer
preliminarily knows about the issues it solves. Comments like "Here,
compilers should suppose new object at reused storage" will be wanted
each time it is used.

On the other hand, assuming its rare uses, usually in libraries, a long
name won't be so much problem. Thus, I think a longer and descriptive
name is more appropriate. As a bonus, it will be more usable as a search
key to find relevant articles about it.

It could be std::suppose_new_at_reused_storage(), as a strawman. The
example at [ptr.launder] would look like this:

  struct X { const int n; };
  X *p = new X{3};
  const int a = p->n;
  new (p) X{5}; // p does not point to new object (3.8)
                // because X::n is const
  const int b = p->n; // undefined behavior
  const int c = std::suppose_new_at_reused_storage(p)->n; // OK


What do you think? Is it too late? 
Does someone know the history of the naming?

-- 
k_satoda

-- 
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/1cd5895f-df27-9cda-73cf-cbc2f1488a2c%40f2.dion.ne.jp.

.
