220 27728 <6322c6eb-76f7-47cc-b012-db8c5d8892fc@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: rhalbersma@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: if constexpr in class declaration
Date: Tue, 9 Aug 2016 15:01:33 -0700 (PDT)
Lines: 78
Approved: news@gmane.org
Message-ID: <6322c6eb-76f7-47cc-b012-db8c5d8892fc@isocpp.org>
References: <b802b9e3-9f14-4b93-afb5-47b5dc5034a1@isocpp.org>
 <CAOfiQq=6+9_qGF-EEHjJ_bpt993s0amWHwoE=WABHXCCu+xc5Q@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_761_1141610826.1470780093348"
X-Trace: blaine.gmane.org 1470780100 20345 195.159.176.226 (9 Aug 2016 22:01:40 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 9 Aug 2016 22:01:40 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCMYZKMJV4IRBPVFVG6QKGQERJZHD2I@isocpp.org Wed Aug 10 00:01:36 2016
Return-path: <std-proposals+bncBCMYZKMJV4IRBPVFVG6QKGQERJZHD2I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f197.google.com ([209.85.217.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCMYZKMJV4IRBPVFVG6QKGQERJZHD2I@isocpp.org>)
	id 1bXF5b-0005Ad-P9
	for gclcip-std-proposals@m.gmane.org; Wed, 10 Aug 2016 00:01:35 +0200
Original-Received: by mail-ua0-f197.google.com with SMTP id u13sf50946088uau.2
        for <gclcip-std-proposals@m.gmane.org>; Tue, 09 Aug 2016 15:01:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to: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=9Hv0iQN0W7TBOejxQa2WQaCmlepLsKb5QHh02Q4Ij7w=;
        b=EcYxfchH38YZp+bSoafCj/qFpOfPcBLE0wG48O3HmZFNDbWqVl7sRX+hJAQ4jOgFKe
         Zkrk/ainICA6zAPk8S4qDfQ5ZY5DOX24y7hvaRtVZpS6FW7vlMV+ZOzYNDq99GvijIqY
         CZgwWkcHHE4pzxPmRGdDqwNYRNryjt/LoPSnMmFUPWTsg/9jJ/k/hfiZrE8XxJMOcPWH
         jivsYKfo0sJPmBYbKQvg0zVD7b3LCWVV4ONSdGcMhF0F2iQIXFBVS1h9pawOgTU1MINF
         PH0PBDGSHV41oxnE5csl9nH829BurFxGiAWpP7+jlO/YLmWCgnTy60ImxhJXKkZ/FkQI
         7eUg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to: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=9Hv0iQN0W7TBOejxQa2WQaCmlepLsKb5QHh02Q4Ij7w=;
        b=D6BdHNHRpO/G4M1ToHsnNtKdbNm9fcpStvkZne41lKCrgTo6P9mmqOWx/El89g+SMC
         pWmwqVeaLq+bd8JI4Z3tXkD4uO4aHEAkR3EfHy4Temk+cIDpehHTRpGcXWvD8SUk2x9d
         n7p9WWbTNchTQrRS1+WheNvOxM5qZ4CGtiJyGncHfmzC2MUpIy1F9P6f+OyC8Hw8jTTu
         xUeGXxzhZZT63ILTpdgIk3mnq9Aq0SLvBXtg0HsWkBqjIiOZYxCzZRKCCOtJmBBCsN2B
         otwM8GSb/IiPE78sgfrmgDtucOUouE/fy7fnbo8gRWRJQlPaFj6o7S3aINe/xSpcg7Ci
         iLPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to: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=9Hv0iQN0W7TBOejxQa2WQaCmlepLsKb5QHh02Q4Ij7w=;
        b=KBdQlKxaylgEk3qsl7n/CftHyo/gZnsJx6nim7eZNMNjgXck0R5edTVtb+ldEIrvl2
         +h6FpbM8lE5imARl21WHO8NGALTCFlGjVyrCwATVFmlFM5lyB4ZMDGrco1ILIZTZPwsL
         nV1WIrQna/Ypt+os9u9EpipAT032c37En71EZlLGydOZGyQ1AQ2VvaAEeswaoxc2vZV7
         8OVQg6JqaIBsMD6ZSOvQtbdENuDNq6YdIwMWvejuDzLnzEUaUsDawLjhevCqZQk8kqjJ
         0oP3kEFqrAIQUC5IS35fjHs530as4v73SiYbt3Ynuiym6+KIzOsQfLk4rwxae7nGg0HK
         hCdQ==
X-Gm-Message-State: AEkooutBV5aDsFWh6xW0KZKtOnmUUL/ECVcVT3LCPYMM9UgZ0/UOnl1UR10klkXuz2CF0A==
X-Received: by 10.31.166.196 with SMTP id p187mr498190vke.4.1470780095838;
        Tue, 09 Aug 2016 15:01:35 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.55.214 with SMTP id e205ls5185877ioa.11.gmail; Tue, 09 Aug
 2016 15:01:34 -0700 (PDT)
X-Received: by 10.36.50.145 with SMTP id j139mr107303ita.9.1470780094634;
        Tue, 09 Aug 2016 15:01:34 -0700 (PDT)
In-Reply-To: <CAOfiQq=6+9_qGF-EEHjJ_bpt993s0amWHwoE=WABHXCCu+xc5Q@mail.gmail.com>
X-Original-Sender: rhalbersma@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:27728
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/27728>

------=_Part_761_1141610826.1470780093348
Content-Type: multipart/alternative; 
	boundary="----=_Part_762_1490687678.1470780093348"

------=_Part_762_1490687678.1470780093348
Content-Type: text/plain; charset=UTF-8



On Tuesday, August 9, 2016 at 7:56:22 PM UTC+2, Richard Smith wrote:
>
>
> Yes, it's been thought about, but this is doing something fundamentally 
> different from what 'if constexpr' does, and it has major practical 
> problems. You can look through the history of papers on constexpr if and 
> static if for a taste of the problems.
>

I understand that applying if-constexpr to conditional data member layout 
is different because a regular if cannot appear at class scope. But reading 
the static if papers and their critiques, the supplied alternative to the 
OP's example using partial specializations, tuple and empty base class 
trickery do not really provide a superior alternative. Optimal class layout 
is currently cumbersome, using if-constexpr would make this a lot easier 
for users. 

What exactly would be making it hard (compared to if-constexpr at function 
scope) for the compiler to do the conditional data layout using 
if-constexpr?

-- 
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/6322c6eb-76f7-47cc-b012-db8c5d8892fc%40isocpp.org.

------=_Part_762_1490687678.1470780093348
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Tuesday, August 9, 2016 at 7:56:22 PM UTC+2, Ri=
chard Smith wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr"><div class=3D"gmail_quote"><div><br></div><div>Yes, it&#39;s been thou=
ght about, but this is doing something fundamentally different from what &#=
39;if constexpr&#39; does, and it has major practical problems. You can loo=
k through the history of papers on constexpr if and static if for a taste o=
f the problems.</div></div></div></blockquote><div><br></div><div>I underst=
and that applying if-constexpr to conditional data member layout is differe=
nt because a regular if cannot appear at class scope. But reading the stati=
c if papers and their critiques, the supplied alternative to the OP&#39;s e=
xample using partial specializations, tuple and empty base class trickery d=
o not really provide a superior alternative. Optimal class layout is curren=
tly cumbersome, using if-constexpr would make this a lot easier for users.=
=C2=A0</div><div><br></div><div>What exactly would be making it hard (compa=
red to if-constexpr at function scope) for the compiler to do the condition=
al data layout using if-constexpr?</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/6322c6eb-76f7-47cc-b012-db8c5d8892fc%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/6322c6eb-76f7-47cc-b012-db8c5d8892fc=
%40isocpp.org</a>.<br />

------=_Part_762_1490687678.1470780093348--

------=_Part_761_1141610826.1470780093348--

.
