220 33783 <3784a92f-9045-e0e8-df9f-51a68f66ac99@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: properties?
Date: Thu, 10 Aug 2017 10:05:12 -0400
Lines: 35
Approved: news@gmane.org
Message-ID: <3784a92f-9045-e0e8-df9f-51a68f66ac99@gmail.com>
References: <6ed2bd55-5538-418f-8f1a-263a9958babd@isocpp.org>
 <omgfdk$pkv$1@blaine.gmane.org>
 <9979b017-fc21-445f-a1d1-0f55f8e7bf3d@isocpp.org>
 <CAFk2RUadaK3Dz_EgKMCp=UP84-VgZHtjnPaRn4yZTnADgUqgnQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1502373936 722 195.159.176.226 (10 Aug 2017 14:05:36 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 10 Aug 2017 14:05:36 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.2.1
Cc: bop@gmb.dk
To: std-proposals@isocpp.org, Ville Voutilainen <ville.voutilainen@gmail.com>
Original-X-From: std-proposals+bncBC37LBFWUIFBBG6QWHGAKGQEKETLPJA@isocpp.org Thu Aug 10 16:05:28 2017
Return-path: <std-proposals+bncBC37LBFWUIFBBG6QWHGAKGQEKETLPJA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f200.google.com ([209.85.217.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBG6QWHGAKGQEKETLPJA@isocpp.org>)
	id 1dfo5G-0007Vq-C0
	for gclcip-std-proposals@m.gmane.org; Thu, 10 Aug 2017 16:05:10 +0200
Original-Received: by mail-ua0-f200.google.com with SMTP id x5sf2879534uai.9
        for <gclcip-std-proposals@m.gmane.org>; Thu, 10 Aug 2017 07:05:17 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1502373916; cv=pass;
        d=google.com; s=arc-20160816;
        b=DZAqnRf5POpVPElbz61ehKEgjMckKuwXzH/mKjJGLvDD2vkZjhnOyuN6eIxflDUgca
         6RrVyFEKn5v8Ucyfnk1VnPkt71MsXKkL18baCpZKsG+Ej/tDtcYBG7WNha+y7OPixeLj
         l13k9gwlLxqjg032g6O8IYRlwgQMhyPNUrxGXfT2wWZyYP+QY4ypj1PKEzig5xs7Psjc
         Tg0cV8UxbdRz7OWAqSEZfzf9Z+Jm1QsC4vm7l2O6PBymkgEP0Rv/qsJBQC6h8S0AMjdn
         WldSfeyl3D1/BaI6XIdDPiaEk8jX06/mIS3G5J8Enn/QvI18fk+XBIROLIEZ0ohvw+KK
         Sc3g==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:content-language
         :in-reply-to:mime-version:user-agent:date:message-id:from:references
         :newsgroups:cc:to:subject:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=lDYbMhu+JGTlWaNHnoS8zSwID6uW8/+Pt3oT/fKfSWM=;
        b=e+YRWEFSJjE55dPKn1Haf3t4q4Pr2azy5Lbl8kVEqyKLNnfMX7WpxygYmI+n+2UV1g
         JBJL4cj/u61rBnoWH+ZibNoUh8zOivWRuM7rAlmfW4ot+LIWlGmILJn+zDx1D7fG7nSp
         chCv6b5XUOdy92cTRHMHVnzMlG8EMD/X486hr9zwpWI6gd6EtcWWE+R3v0P0Jk8SiT1j
         b++kvjfMKMCxY8qZWmjdOW6Qx+7uFWw2vVYUfv9XTcpJXF9dsh4BuzJDzlkRlhfsbiVs
         o444asGolyPcaZl6qrIW623nufgik4wfeZ4WUFMTrbU4raWwoxqSguIw9A2TvuJ4BIcA
      
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=b1Yzbawx;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:400d:c09::243 as permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:cc:newsgroups:references:from:message-id:date:user-agent
         :mime-version:in-reply-to:content-language:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=lDYbMhu+JGTlWaNHnoS8zSwID6uW8/+Pt3oT/fKfSWM=;
        b=lMZSVbWmAZodA9M/bDmbh0Zl3Q08dnQU8w3tRrxP3Er7XpkRNBnEzV9PxGHLjiaO1H
         wNPIkrKLpo1e8IRt5h+Kw1fIea46TVayzYHrX3tFa99lADTca2Fnye7s4pntw2c+3PoS
         GIDBxuWK/4MyPoQ6M1x9HH2jPgQN+mW6b8mPVpniq/BRl0CIcr9sAp8xZfX9/Akv/S1X
         2jKqap527VCVH+YL2dP74M9PAhIDOG+AbxgGXgUWxW73IhG0X4crcwrGyg7mM+JJF/N9
         llbbHJYbIUVfHH4o04wCLLyqB0d7Db1C4WrQ/6HMzDwumIU15Ufu1zdIqP8HyU0U3BiC
         6kPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:cc:newsgroups:references:from
         :message-id:date:user-agent:mime-version:in-reply-to
         :content-language: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=lDYbMhu+JGTlWaNHnoS8zSwID6uW8/+Pt3oT/fKfSWM=;
        b=OvfixMIPI4w6zh1DjYPrX7IkbUwC4tH4cIp4Tauw0O908g/Bd5fDWN0TvMHr7SOriN
         fu9pegHWfgyZQKvWgn0YL56Kq8UzbXrI3O8I6DoYDfOa87rcGMtJH0lfu13hV6rYqg16
         3PvrHoyNYa6EocztS9JPXkM1v+O8x6QIyxJtkdpAfjGjzHtJAR6DWVFl2VLMkHnKd52t
         oJGRFcsOHT06FRzdOG4Cr/ao/0jrcH/Roqp4CPEOjv/IAXpzdb95+Ppuel/yjQJnFW8f
         d2pr9lvzepahWZ2WImvMzzcJHnuPR+vYxl4HmENb/MrkiBw8EcxYhzy 
X-Gm-Message-State: AHYfb5jTWl8vwLBynvrS46gqrqNWYNWb1LV2TeXyYW6+rl9UrMhiP9Ab
	M8JbC/oFVBBplRt0
X-Received: by 10.31.69.7 with SMTP id s7mr6793399vka.11.1502373916585;
        Thu, 10 Aug 2017 07:05:16 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.134.70 with SMTP id i67ls6866695iod.12.gmail; Thu, 10 Aug
 2017 07:05:15 -0700 (PDT)
X-Received: by 10.237.32.2 with SMTP id 2mr15806882qta.161.1502373915282;
        Thu, 10 Aug 2017 07:05:15 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1502373915; cv=none;
        d=google.com; s=arc-20160816;
        b=aMF//2RQb158wAk0tueVcQa/NNneyI3asMSUZkCmN2xdfQKQVJvfipMntORereFxDj
         LhwHZy5Bplp+wYgG1MZpRBUYFzZiLQyx6CwAGwGsxkUXfICi81wY5aJgO5H/QOsprxwL
         Js4tGkRoLmvq4Wg9xKPkOMphYfX7as8LjPk7SBYX+rNusNOL4Dv0OhwiesExSUw1tYIL
         zo2IqMw2ZBV9gdtJUcBXRikhmjn3erFX27Oss/dlXj1Wg83uK/hAZr1h9h8pCzYp3p9l
         w8syDaQHqthr03aR7JQm5hkk14OXTGIkb5rmTiEVNmlB/4zY0pH/JoEQNOrptmObQHt/
         gB0A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:content-language:in-reply-to:mime-version
         :user-agent:date:message-id:from:references:newsgroups:cc:to:subject
         :dkim-signature:arc-authentication-results;
        bh=a0R+XHMyCQ1R6eACC8s9dew2qlP2+xRe+pJjSogE25g=;
        b=Erpp9eq+3B7dPGs5EfbTy3L0tRf0C8LU4iz6xmgwyMFF0yYwiW64XBVhJgS7sdB4Z9
         d0xhAy2x2niSlqtjMnVsty+t46UkPvgSuMd8FWeUfeq4YZel3DsR6i9+3Ns2ENK0zH4l
         m4jkI3fIiwERr6GVdgjrzG+yG1q9j7DVv/rH/VsnHS60NueClYY6K/RxwGTvSoTTde+5
         drtgbEuuR6Bvx/E5vOHS+cJeEl7yOynUbRj/Qcuc7u+71i81UtImCZn5L0TRLAKFy9FE
         uS+PwVHNTieNutmtwieXKIU+rCpS4ZgVy2GGUSrG3ss47kwwSQzzXEyHc7bx5FfzUqi9
         G9Yw==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=b1Yzbawx;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:400d:c09::243 as permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-qk0-x243.google.com (mail-qk0-x243.google.com. [2607:f8b0:400d:c09::243])
        by mx.google.com with ESMTPS id 23si5652026qtx.357.2017.08.10.07.05.15
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 10 Aug 2017 07:05:15 -0700 (PDT)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:400d:c09::243 as permitted sender) client-ip=2607:f8b0:400d:c09::243;
Original-Received: by mail-qk0-x243.google.com with SMTP id d136so742768qkg.3
        for <std-proposals@isocpp.org>; Thu, 10 Aug 2017 07:05:15 -0700 (PDT)
X-Received: by 10.55.25.41 with SMTP id k41mr15802544qkh.354.1502373914537;
        Thu, 10 Aug 2017 07:05:14 -0700 (PDT)
Original-Received: from gryphon.kitware.com (tripoint.kitware.com. [66.194.253.20])
        by smtp.googlemail.com with ESMTPSA id c5sm3483985qkd.27.2017.08.10.07.05.13
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 10 Aug 2017 07:05:13 -0700 (PDT)
Original-Newsgroups: gmane.comp.lang.c++.isocpp.proposals
In-Reply-To: <CAFk2RUadaK3Dz_EgKMCp=UP84-VgZHtjnPaRn4yZTnADgUqgnQ@mail.gmail.com>
Content-Language: en-US
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=b1Yzbawx;       spf=pass
 (google.com: domain of mwoehlke.floss@gmail.com designates
 2607:f8b0:400d:c09::243 as permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;
       dmarc=pass (p=NONE sp=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-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:33783
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33783>

On 2017-08-10 02:35, Ville Voutilainen wrote:
> On 10 August 2017 at 09:19, Nicol Bolas <jmckesson@gmail.com> wrote:
>> On Wednesday, August 9, 2017 at 10:12:36 PM UTC-4, Bo Persson wrote:
>>> On 2017-08-09 19:32, Evan Teran wrote:
>>>>      std::cout <<value.data <<"\n"
>>>
>>> This could already work if you just add () to each use of data.  :-)
>>
>> Would it? Would this:
>>
>> some_function(value.data());
>>
>> Would that allow `some_function` to set `data`'s value? To do that, you
>> would need to make `data()` return a proxy object, which can be converted
>> into the appropriate type, but can also be assigned to the appropriate type
>> and otherwise treated exactly like a reference to the other type.
>>
>> That's hardly "just" adding something.
> 
> Gee, data() could just return a reference.

....which is only possible if it is okay for the user to directly assign
to the underlying data member. If something non-trivial needs to happen
when the property is assigned, then no, you'd need to return a proxy
object. (And, alas, some_function would need to be a template.)

-- 
Matthew

-- 
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/3784a92f-9045-e0e8-df9f-51a68f66ac99%40gmail.com.

.
