220 33785 <ab000071-6881-487f-b507-bcd6d656bb52@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: properties?
Date: Thu, 10 Aug 2017 07:18:13 -0700 (PDT)
Lines: 123
Approved: news@gmane.org
Message-ID: <ab000071-6881-487f-b507-bcd6d656bb52@isocpp.org>
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>
 <3784a92f-9045-e0e8-df9f-51a68f66ac99@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_940_901225916.1502374693617"
X-Trace: blaine.gmane.org 1502374705 16947 195.159.176.226 (10 Aug 2017 14:18:25 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 10 Aug 2017 14:18:25 +0000 (UTC)
Cc: ville.voutilainen@gmail.com, bop@gmb.dk
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBJWWWHGAKGQE3K7X6BQ@isocpp.org Thu Aug 10 16:18:20 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBBJWWWHGAKGQE3K7X6BQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f199.google.com ([209.85.217.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBJWWWHGAKGQE3K7X6BQ@isocpp.org>)
	id 1dfoHp-0003ci-IF
	for gclcip-std-proposals@m.gmane.org; Thu, 10 Aug 2017 16:18:09 +0200
Original-Received: by mail-ua0-f199.google.com with SMTP id f9sf3067982uaf.1
        for <gclcip-std-proposals@m.gmane.org>; Thu, 10 Aug 2017 07:18:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc: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=YQJEY6Z+1muxQwRvr/jaT64LYHhR4tJ72Xc6khTcKwg=;
        b=Xe7z+Z9N0OVNXaMhC7Z+pBUC0JPTmIc1C+I7i349EiOj4PNfPQmQGBWO9sAH2YAGt+
         JSOzY3oUmh1jiZ3QqdZrvS27TbApvRrWQvUZIYkdVAjW0RP46vhkkvWl1Kb2Ux6UiYdd
         rTxpeOczdLtj1aII+af4Z9s4aNNQUj5YXbz6j59ignNBiElHJwBrd9YuVitYDiAULUAd
         UGR0qQakmRASyp34XBK6t0zORaXQkVBm88Z262/xNKXGneTN5L+TZo2zmoUmdFWmHT0U
         FrTpC48ZvZ3uTzALmOQBu/hpDwn6lf2MHG5miCYzmod4gz3aQKKNgEQodJfIy4zSGNSV
         PxfA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc: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=YQJEY6Z+1muxQwRvr/jaT64LYHhR4tJ72Xc6khTcKwg=;
        b=HRyZk/HiVf8a+Oq9AQk1V8kO0r0NmI9zE+saxJOilTR6a1nS6FUYjqp5FwSCY5Uf11
         NJvUQqt1lPowFO4iw4qUMbj94xhAA9WEHyxnWMNQEA5412POsV97ENhBNCs0nPxl4Yf/
         uDFlw0mbdzXEKiFtKOzSAISyCxvpy3AqRe3ioJdN8ezLjS+CWtkcjGMeH38KyzOs06MP
         tgabb6neTNwJMLPNVNz5XHhaePEYuVuo4oklMAdXtDY7Exa45WG+sUOFQ+hcYBan2AD5
         CqMz6SBxxV9LWjSq71xKIQ9szaxusiY50dS1ETjw1apBcVUGQHcVeOZI2JWfw0R3BgnU
         Mypw==
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:cc: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=YQJEY6Z+1muxQwRvr/jaT64LYHhR4tJ72Xc6khTcKwg=;
        b=hIelFFf1Vkyas7jaGnWH2WhLwozTVDf1q7P+hbdIvFXRHNqqPFKQacisADyFs3cGh0
         4Vrun1QPyOKGLonGVBu+OHUdTstUCYBIQoxreY9WREXgjrC9JYGb23NMYLD6zGCffjOC
         z6zVeOTZM5+fn4JNwoSkkrhpIhpMCxYmTmosr3KMWi4ViBmyP/AjhKWzdxI0tdPbOwPd
         Q5koy07bhucZi3win3m+909l8BuAmW/iGdmZXUkyalsXMY3Jzv2Q+KYvQokjh4qDRYYw
         vbAI1RT+chTjg6KedKOy9qFaUXvL82Uet7ZjpzDZs+vhBguzQ7tndn6bSgWbQzD3mKW2
         jyiw==
X-Gm-Message-State: AHYfb5izZOTf2qM08rQP4T2JeKyzLuUySF7lfRO940A66pp8nkNun/LQ
	ujba21Qg66ipQCZD
X-Received: by 10.31.168.14 with SMTP id r14mr6836084vke.21.1502374695402;
        Thu, 10 Aug 2017 07:18:15 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.197.194 with SMTP id f185ls10899760itg.4.canary-gmail; Thu,
 10 Aug 2017 07:18:14 -0700 (PDT)
X-Received: by 10.31.169.17 with SMTP id s17mr62047vke.11.1502374694083;
        Thu, 10 Aug 2017 07:18:14 -0700 (PDT)
In-Reply-To: <3784a92f-9045-e0e8-df9f-51a68f66ac99@gmail.com>
X-Original-Sender: jmckesson@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:33785
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33785>

------=_Part_940_901225916.1502374693617
Content-Type: multipart/alternative; 
	boundary="----=_Part_941_1951000555.1502374693617"

------=_Part_941_1951000555.1502374693617
Content-Type: text/plain; charset="UTF-8"

On Thursday, August 10, 2017 at 10:05:17 AM UTC-4, Matthew Woehlke wrote:
>
> On 2017-08-10 02:35, Ville Voutilainen wrote: 
> > On 10 August 2017 at 09:19, Nicol Bolas <jmck...@gmail.com <javascript:>> 
> 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.) 


Not to mention that it assumes that there is actually an object behind 
`data()` that could be returned as a reference. Many properties are 
phantasmal; the actual data is not stored in the type it appears as. 
Indeed, one could say that the whole point of properties as a feature are 
that they *can be* phantasmal in such a way, without the user being aware 
of their nature.

-- 
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/ab000071-6881-487f-b507-bcd6d656bb52%40isocpp.org.

------=_Part_941_1951000555.1502374693617
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thursday, August 10, 2017 at 10:05:17 AM UTC-4, Matthew=
 Woehlke wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 2017-08-10 0=
2:35, Ville Voutilainen wrote:
<br>&gt; On 10 August 2017 at 09:19, Nicol Bolas &lt;<a href=3D"javascript:=
" target=3D"_blank" gdf-obfuscated-mailto=3D"bgI50Fh3BwAJ" rel=3D"nofollow"=
 onmousedown=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"=
this.href=3D&#39;javascript:&#39;;return true;">jmck...@gmail.com</a>&gt; w=
rote:
<br>&gt;&gt; On Wednesday, August 9, 2017 at 10:12:36 PM UTC-4, Bo Persson =
wrote:
<br>&gt;&gt;&gt; On 2017-08-09 19:32, Evan Teran wrote:
<br>&gt;&gt;&gt;&gt; =C2=A0 =C2=A0 =C2=A0std::cout &lt;&lt;value.data &lt;&=
lt;&quot;\n&quot;
<br>&gt;&gt;&gt;
<br>&gt;&gt;&gt; This could already work if you just add () to each use of =
data. =C2=A0:-)
<br>&gt;&gt;
<br>&gt;&gt; Would it? Would this:
<br>&gt;&gt;
<br>&gt;&gt; some_function(value.data());
<br>&gt;&gt;
<br>&gt;&gt; Would that allow `some_function` to set `data`&#39;s value? To=
 do that, you
<br>&gt;&gt; would need to make `data()` return a proxy object, which can b=
e converted
<br>&gt;&gt; into the appropriate type, but can also be assigned to the app=
ropriate type
<br>&gt;&gt; and otherwise treated exactly like a reference to the other ty=
pe.
<br>&gt;&gt;
<br>&gt;&gt; That&#39;s hardly &quot;just&quot; adding something.
<br>&gt;=20
<br>&gt; Gee, data() could just return a reference.
<br>
<br>...which is only possible if it is okay for the user to directly assign
<br>to the underlying data member. If something non-trivial needs to happen
<br>when the property is assigned, then no, you&#39;d need to return a prox=
y
<br>object. (And, alas, some_function would need to be a template.) </block=
quote><div><br>Not to mention that it assumes that there is actually an obj=
ect behind `data()` that could be returned as a reference. Many properties =
are phantasmal; the actual data is not stored in the type it appears as. In=
deed, one could say that the whole point of properties as a feature are tha=
t they <i>can be</i> phantasmal in such a way, without the user being aware=
 of their nature.<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/ab000071-6881-487f-b507-bcd6d656bb52%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/ab000071-6881-487f-b507-bcd6d656bb52=
%40isocpp.org</a>.<br />

------=_Part_941_1951000555.1502374693617--

------=_Part_940_901225916.1502374693617--

.
