220 33877 <2546050.sL0pCq2xIu@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Auto-Pimpl by partial
Date: Sun, 13 Aug 2017 13:52:48 -0700
Lines: 58
Approved: news@gmane.org
Message-ID: <2546050.sL0pCq2xIu@tjmaciei-mobl1>
References: <0e49ee2a-2ead-431d-83ae-54587c1b8c8e@isocpp.org> <1853356.WW4VBYSKBC@tjmaciei-mobl1> <2e940bb4-f8d4-4a02-9802-0036af7efc09@isocpp.org>
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 1502657577 16665 195.159.176.226 (13 Aug 2017 20:52:57 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 13 Aug 2017 20:52:57 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBJPYYLGAKGQE3TVSDNI@isocpp.org Sun Aug 13 22:52:51 2017
Return-path: <std-proposals+bncBCB4TK757YBRBJPYYLGAKGQE3TVSDNI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBJPYYLGAKGQE3TVSDNI@isocpp.org>)
	id 1dgzsO-0003or-RR
	for gclcip-std-proposals@m.gmane.org; Sun, 13 Aug 2017 22:52:49 +0200
Original-Received: by mail-yw0-f199.google.com with SMTP id t139sf154221873ywg.6
        for <gclcip-std-proposals@m.gmane.org>; Sun, 13 Aug 2017 13:52:55 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1502657574; cv=pass;
        d=google.com; s=arc-20160816;
        b=o25vZWOnLI6e7Bk+FvSoIvnslh1MiQCHzU500OKVVrK7XQLVLFfR0a3dPREAAbUI4v
         jjPjrGtRIDyb+z9Yt+hIM1CpWEX4ZR0i6PyC5m3R0Uu/AMPABO817BPlUCwwbqYaWnCq
         5sq8zeoqvNWXSKNlwU9cnWNdsTlpT52UG0hjegGjseL+aS2ovusdtaA1Cj03GuZhFG3v
         zYSl9UkQ3W/gtt1Y6BKFRYLK368mg4ciotw1fZHD1VaFaPSho2WRqPIvzYnCozFGSgRd
         +D8RLDawIEb4C9+6hBMJprpCtGe8wuoXTquuorSr1PqGBXf1Jy0v1+Xe9F9VPRoYMcCV
         crEw==
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:mime-version:references
         :in-reply-to:message-id:date:subject:to:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=OhD6W6XFCba01LuF3ZkoJPzrZlJLrVvR6kyk3GT31pI=;
        b=WYLaX9yNpR1C+b46Sy+WBpzPAfEaysT44EG60t8RAjpT9VmLKM4utTULU81iZwyxFC
         Q8hBupibCWOck/+RJWlLzQ8i7q6/qGUU6I9wtdoAMzl43BdvfhwltyEWB2KYCetLBLrg
         sEriMq2gGacHgGbG0c9UJDyKKJKRQSXuN9ED/oy6W2zsH7xohLHfg7ScvkOdVujunqfU
         nZzBD+Wlx6rdK3+zXlILvpJ29uxxPe07JYAgHjBgOY89uzg6sLX6hpQxviXkFjW5yW3Q
         XQJY7OeyodtTOsMFyvDdIFuRXcKXfridsGaopwN0fmAwzTTdZIauFl1Fgd+V1zV0lKx8
         A/VA==
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) smtp.mailfrom=thiago@macieira.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:in-reply-to:references:mime-version
         :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=OhD6W6XFCba01LuF3ZkoJPzrZlJLrVvR6kyk3GT31pI=;
        b=KBsKpp4jrqQLRN/UwIZf4sZnKtZHBL4KSJuIssF5/pyC3STWtRVU1JdiahXC5o8hHp
         BCmkaovdTLuZk1P0N8vp2crl2FJViUdf18D1ds7aslk8o7V5kdmjDN1Qh2uXhePPWnmN
         0kP5E77ALAoO6uaTBhWQvBZnra51f/D1PdRz4tyIXeC4WslD5d+pIn6fX33Y+HDx/O5G
         E4D4DqRApyI8vz+E2SuFHJ9WHAgONcSpiJc+jaHKZYuO+er0+yR53XW2XEiKSUV/t0BD
         8SJhImUA7tV5FTPLNpOfVnISnE2M2fG5zv7IYN4n2Prbjv/bRihaSR4Be7Z7VN1IQ0R5
         OGZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
         :references: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=OhD6W6XFCba01LuF3ZkoJPzrZlJLrVvR6kyk3GT31pI=;
        b=nTDqwXv2QlTgLPlV9s6OiMtmWR8y6WF11O8PD/sgnHXWLMYlMxYTBY5rBkSIC4RUAs
         xP5NZAIcJapV3r8Zu3jGZ4Jc6/i8GF4VU60X4SnbxhF2IZPKBBYC3t4c8m+0BOD7sROD
         5ud2GGR19EYSKq7R1G2I8FZu2VKW5pwBShBooSP1MgZ5sduI8oBngfud4c6Oi+mtTOFx
         VrkkcQReg7Z3EHAdpLBMx4QSRBPFojOepftL2hk6jF+x7ACTN74aL1efDh7C73XkCjra
         bVhvpEWrJaLqsqhklLUPankLOsfKSwzrFxvSHmiEs3ZNDrjtFq00QhGSq55hV6W83rpx
         nzlg==
X-Gm-Message-State: AHYfb5gLiLLtnR1jZq+dl61XW//azajiecCm4wlwxeomV0RgUHQUqS0V
	y/CKI3g98ktp6/P6
X-Received: by 10.129.49.74 with SMTP id x71mr15241068ywx.84.1502657574755;
        Sun, 13 Aug 2017 13:52:54 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.192.65 with SMTP id u62ls2490149itf.2.gmail; Sun, 13 Aug
 2017 13:52:53 -0700 (PDT)
X-Received: by 10.36.66.16 with SMTP id i16mr3841472itb.132.1502657573354;
        Sun, 13 Aug 2017 13:52:53 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1502657573; cv=none;
        d=google.com; s=arc-20160816;
        b=B4cY1xMFU4RZyhFoK8d3luW7hrsI6Nw4Mx6ZD4WztbPsuIETUPBYnEuB5b8p/RSrQg
         0k8rpIBBQPB/UFIDRFOheH0wh7lTvyNoBn7HntLYPv6mrJ642hiT/1JdQvfD0BIbW65j
         Wl2xcYp6DFr/LpEnRgJ8ABhMQScsePdcmStpNEOfV3PVWL/lVjM95S9QkerSjeA4Pw+R
         2HLcX+UwheqO7FhrlkmeOYKV/xzc+PutinvzV28h8MXpRQ8z4NJ4BX2jzRtwfddvWTa8
         NjAcvl+NoljkoMPCyrwo2uFp3dglxFFn6XhKt+f/wGzIAGW9w3/SDufuI7FUNvp+q+ST
         r9NA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:arc-authentication-results;
        bh=02sP9e7K2uiYm8F1tFkdpkFA/4SKmpXzOvBoNTzIpJk=;
        b=TqTyBGLW+REfxnyDD2b2P94CIPWUdLHt+7vyN6yEqeEhCzYrxFHA5P8qsnpGRKbnXu
         Wn8Kbu+mMZ2w5EtHO+TsS9Mxp4CCFL3y7o4P6kRoRyxBYRICBcKHt0hFVLIbPQeBHHiO
         vj5G4mxSWD9Z9LT6nPT9IVtlf7jXQOll38q6fBPVUlAmWDpiBWHqj7kDnkCiu5QfD+j5
         V0kdXDsKuxk6vnzdJZSDOHJKXKVd6YNTh1VleVRj0UbmH+qIj/254hs14ZMWVre1EAv9
         Ot6uATUUCmmiv9gO5Z0dn9mZzHzZkajj7nXcecUwGAYuiOK+Pfeun4gmFyQjnS3XDVgZ
         3D+g==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) smtp.mailfrom=thiago@macieira.org
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id 37si5668779iop.51.2017.08.13.13.52.52
        for <std-proposals@isocpp.org>;
        Sun, 13 Aug 2017 13:52:52 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl1.localnet (unknown [IPv6:2601:1c0:4501:5f9f:c73:d163:e3f0:34af])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 0D54011B72B
	for <std-proposals@isocpp.org>; Sun, 13 Aug 2017 13:52:49 -0700 (PDT)
In-Reply-To: <2e940bb4-f8d4-4a02-9802-0036af7efc09@isocpp.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 as permitted sender) smtp.mailfrom=thiago@macieira.org
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:33877
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33877>

On Sunday, 13 August 2017 01:51:49 PDT Izzy Coding wrote:
> I'm not sure exactly how the implementation would work as I have not sat
> down to fully flesh it out yet. But, I would hope and strive to ensure zero
> overhead where possible.

That imples no heap allocation, which means the full object size must be known 
at any point in the instantiation.

That means your feature request is no different than inheritance, with the 
possible exception of making the partial types non-instantiable without 
requiring a pure virtual method inside. Of course, you could achieve the same 
by way of a protected, default constructor (or private if you want to ensure 
only you can derive from it).

The only visible difference I can think of would be the typeid() and reflection 
of the objects.

> Inheritance would require multiple class definitions spread across multiple
> sets of .h and .cpp files (or if you like to dump multiple things in a
> single file you could do it as 2 files, but I doubt many people do this).

Which your proposal also asks for.

> Also This allows creation of FirstThing independent of FullThing.

No, it doesn't. See above.

> Partial just tells the compiler that I don't care what the full size of
> Thing is, I just want access to the view I do have a definition for. These
> can only be created in full (requiring include of full definition chain so
> allocation can happen as normal), but seen and used as a partial view of
> that full type as required. A FirstThing is a FullThing, but where I only
> care about the size of memory that is defined in first.h. I hope this makes
> sense.
> 
> This allows me to spread the definition of a single type across multiple
> files so that I can keep my includes as minimal as possible and means the
> using class/function only has to know about what it is going to use.

I don't see how that is any different from simple inheritance.

> Also when used with meta-classes each partial could be defined as a
> different meta-class which would include only the required compiler
> transforms available to each level of partial. Which would allow the
> separation of concerns for each set of functionality in a Thing.

Right.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

-- 
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/2546050.sL0pCq2xIu%40tjmaciei-mobl1.

.
