220 33743 <cd0988be-8dc0-43be-96b1-94ec6f8e5e91@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: Wed, 9 Aug 2017 13:20:11 -0700 (PDT)
Lines: 109
Approved: news@gmane.org
Message-ID: <cd0988be-8dc0-43be-96b1-94ec6f8e5e91@isocpp.org>
References: <6ed2bd55-5538-418f-8f1a-263a9958babd@isocpp.org>
 <10557c71-2b0f-6675-305e-1267eeda1ed6@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_155_2040492007.1502310011167"
X-Trace: blaine.gmane.org 1502310012 368 195.159.176.226 (9 Aug 2017 20:20:12 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 9 Aug 2017 20:20:12 +0000 (UTC)
Cc: evan.teran@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBB664VXGAKGQEW4RKUJY@isocpp.org Wed Aug 09 22:20:07 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBB664VXGAKGQEW4RKUJY@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+bncBCEKFTV6ZUMBB664VXGAKGQEW4RKUJY@isocpp.org>)
	id 1dfXSZ-0008Ei-7C
	for gclcip-std-proposals@m.gmane.org; Wed, 09 Aug 2017 22:20:07 +0200
Original-Received: by mail-vk0-f71.google.com with SMTP id s197sf28025787vkb.15
        for <gclcip-std-proposals@m.gmane.org>; Wed, 09 Aug 2017 13:20:13 -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=E1s5+K0zgtv128qElPW2K4evTPZHnlze7WFQLn3kCCA=;
        b=giwaxt296bpfjZxbN+dfZrTq9Nsm836uHqrhibOi1E7iUnTnaHVBUWWQA48Oy/k2Sv
         rZUl/CrFOaKJ9p0+OV8zXjFDoIlGhUT3zx0A3xFkodW0v4BPYdH/E0tRThL49daD0i5X
         JvLb0NbW2RJ881+uhLELB7l7W4podF3d6SRPYyNHsCCrBI3M+DRNxA0QnxRXEJ20SShF
         5eFP/q8x+ZdXlqIezFk2NAZbYCegyqX+hEH0i9Ylr8ONej6s/ECz/IvH4rrRWNAegaSu
         bhkoFAwDGN+SJR+U5KWEtZ+e6wcH3Ml/n9y2L4hXMxaRiHkGZ1mnFaUjjlldlLBGOE2Q
         oHMQ==
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=E1s5+K0zgtv128qElPW2K4evTPZHnlze7WFQLn3kCCA=;
        b=NvPoqeMciHYNQICv384vHAXnugz1x/4HmFxDt7pZn9XZ93QeUir0cCo+v5fS2CftO3
         nl/M4vzSm8yr+inlYG92XEN7TxTYTkobxvo1hNY7Kfl1ZbTR43pMEuEZXWd6QMzF9SEo
         sLOgEhZkQ3rRcWTCQa+wItlbxL2HEU28tgRvE6eZDRppPa18ox8XSddVNnD/QUL33+zg
         L2P+ZmHz4TQRlAKYAsoOIpZVrUF4R5l/rfImT7EePcr6bR9UZO5fvvggMhmLNk1SX2WZ
         L/niBwJySGwOrsVk7SahjOqwvHQOkrRcCSLOUo2UraglVdm1YB4xEqCtQYihq/iWuws+
         ljIw==
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=E1s5+K0zgtv128qElPW2K4evTPZHnlze7WFQLn3kCCA=;
        b=Eqi3NhNq3Lx6a2ETRTqyYeIGGymLYRcVcDq5E1vLnWSt8yZBwox6VybdAqMANzotZd
         kX5IvoJUlCtWSqePzkJVbpeZARwIrhnlXSbEyJLbZYzQ5+CiEDDcfIpHza3mOZ9ApnHJ
         ZNgmZ0kXz0KJ7+3h32LJsmEkKJFnNmHJAl/JNHNga51haAmCJH5Qe8yafDZXt2E6r15d
         hLHBFgtFiCOApDGhs3vfUKkjg5w+il2vsXRlShG9JQRVz8sQ0OfFpRnnrDBHA9BSuMaE
         vhhw9OsaKpxXlWPSqw7oVEyaiotIk6UzTpOqsj8+NIenlr0gGlmL3nccJ2BTOaqw2pfO
         RTcw==
X-Gm-Message-State: AHYfb5hz5ZLdbIQueoNPCnBDBIFWsBOxJS8vfiIgUO1cIZv13zbFRBWu
	fosnXUl/aS13AFl1
X-Received: by 10.176.76.4 with SMTP id l4mr5471269uaf.8.1502310012984;
        Wed, 09 Aug 2017 13:20:12 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.81.65 with SMTP id s62ls6307084ita.9.canary-gmail; Wed, 09
 Aug 2017 13:20:11 -0700 (PDT)
X-Received: by 10.31.99.198 with SMTP id x189mr50805vkb.24.1502310011657;
        Wed, 09 Aug 2017 13:20:11 -0700 (PDT)
In-Reply-To: <10557c71-2b0f-6675-305e-1267eeda1ed6@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:33743
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33743>

------=_Part_155_2040492007.1502310011167
Content-Type: multipart/alternative; 
	boundary="----=_Part_156_1543909948.1502310011167"

------=_Part_156_1543909948.1502310011167
Content-Type: text/plain; charset="UTF-8"



On Wednesday, August 9, 2017 at 1:59:24 PM UTC-4, Matthew Woehlke wrote:
>
> On 2017-08-09 13:32, Evan Teran wrote: 
> > I never brought it up before because I assumed that it MUST have been 
> > discussed in the past... 
>
> It has. To death. Properties are contentious. 
>
> (Nicol and I came up with something maybe a year ago that seemed 
> plausible and had additional benefits, but I don't know if it ever got 
> written up...) 
>

I poked around with the ideas for a while. The basic idea was to provide 3 
independently-useful features that, when combined, would allow you to 
develop a zero-overhead, low-boilerplate library implementation of 
properties. Those features being stateless member subobjects 
<https://github.com/NicolBolas/Proposal-Ideas/blob/master/Stateless%20Subobjects.md>(so 
that the property would just be a member), inner classes (so that the 
property could just be an inner class, which would have access to its 
owning subobject, no matter where it was), and language-support for 
CRTP-base class (so that you could write the implementation of the inner 
class outside of the inner class itself, and thus reuse boilerplate).

My biggest stumbling block was the latter. I realized that I was basically 
creating "mixins," but though inheritance. The problem there is that the 
derived class is incomplete until the template instantiation of the base 
class, so the CRTP-base class can only access features of the derived class 
within functions. That made doing simple things like iterator traits 
impossible without some external class (like `iterator_traits`).

So if I wanted to do mixins without a bunch of arbitrary limitations, 
they'd need to not just be some base class using template trickery, but a 
true, first-class feature that was separate from template instantiation.

-- 
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/cd0988be-8dc0-43be-96b1-94ec6f8e5e91%40isocpp.org.

------=_Part_156_1543909948.1502310011167
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, August 9, 2017 at 1:59:24 PM 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-09 13:32, Evan Teran wrote:
<br>&gt; I never brought it up before because I assumed that it MUST have b=
een=20
<br>&gt; discussed in the past...
<br>
<br>It has. To death. Properties are contentious.
<br>
<br>(Nicol and I came up with something maybe a year ago that seemed
<br>plausible and had additional benefits, but I don&#39;t know if it ever =
got
<br>written up...)
<br></blockquote><div><br>I poked around with the ideas for a while. The ba=
sic idea was to provide 3 independently-useful features that, when combined=
, would allow you to develop a zero-overhead, low-boilerplate library imple=
mentation of properties. Those features being <a href=3D"https://github.com=
/NicolBolas/Proposal-Ideas/blob/master/Stateless%20Subobjects.md">stateless=
 member subobjects </a>(so that the property would just be a member), inner=
 classes (so that the property could just be an inner class, which would ha=
ve access to its owning subobject, no matter where it was), and language-su=
pport for CRTP-base class (so that you could write the implementation of th=
e inner class outside of the inner class itself, and thus reuse boilerplate=
).<br><br>My biggest stumbling block was the latter. I realized that I was =
basically creating &quot;mixins,&quot; but though inheritance. The problem =
there is that the derived class is incomplete until the template instantiat=
ion of the base class, so the CRTP-base class can only access features of t=
he derived class within functions. That made doing simple things like itera=
tor traits impossible without some external class (like `iterator_traits`).=
<br><br>So if I wanted to do mixins without a bunch of arbitrary limitation=
s, they&#39;d need to not just be some base class using template trickery, =
but a true, first-class feature that was separate from template instantiati=
on.<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/cd0988be-8dc0-43be-96b1-94ec6f8e5e91%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/cd0988be-8dc0-43be-96b1-94ec6f8e5e91=
%40isocpp.org</a>.<br />

------=_Part_156_1543909948.1502310011167--

------=_Part_155_2040492007.1502310011167--

.
