220 32119 <61acd2a4-d2f8-41ef-849a-0c47cee485d1@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: HarD Gamer <rodrigojose690@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Allow constexpr static data members in a literal type.
Date: Wed, 19 Apr 2017 09:45:15 -0700 (PDT)
Lines: 124
Approved: news@gmane.org
Message-ID: <61acd2a4-d2f8-41ef-849a-0c47cee485d1@isocpp.org>
References: <dfb9f65c-ea1d-e92b-85e0-333efed1aec5@scylladb.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2727_308742628.1492620315571"
X-Trace: blaine.gmane.org 1492620316 17880 195.159.176.226 (19 Apr 2017 16:45:16 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 19 Apr 2017 16:45:16 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCW7HXOKQ4BRBHFI33DQKGQEPKMYJFQ@isocpp.org Wed Apr 19 18:45:12 2017
Return-path: <std-proposals+bncBCW7HXOKQ4BRBHFI33DQKGQEPKMYJFQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f198.google.com ([209.85.213.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCW7HXOKQ4BRBHFI33DQKGQEPKMYJFQ@isocpp.org>)
	id 1d0sj9-0004YI-1V
	for gclcip-std-proposals@m.gmane.org; Wed, 19 Apr 2017 18:45:11 +0200
Original-Received: by mail-yb0-f198.google.com with SMTP id k204sf12050078ybc.10
        for <gclcip-std-proposals@m.gmane.org>; Wed, 19 Apr 2017 09:45:17 -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=x8jlP9cFSpeN+6gFZhxS6K79lSVYwZfGo+aw4EO8zWc=;
        b=KfSCbVgcu3VIFzQzONgEfUSrlmQV8c1tR1IC/A2S3g4r/IzkoVIhGdBV9ToB3xdOxJ
         gf5WpxcJXpkcDb96rHtr88KKcTtooGDC75Nc1sXGWX8T1/1ZJdiylEoamdHgwLBomcAC
         0ElGJb07NTD0NyCrwnUO4wXdWK+sl6Q4xn4foZ2nZQwonk5BaSjOkG12VabQcPxlxmG8
         wgebCp0A8JNYDdrabO87hjY0K0QXaTbYWHAyA2IacvFmcw80xq2T5fpYJ9+DqD60ioqb
         TX0Yq0MCcYEsZOuUI8P5c1CwiW1O42RGpmBtvIvsuCNGHb0YWKeKpujcTjS4nm22Lz3v
         KgoA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        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=x8jlP9cFSpeN+6gFZhxS6K79lSVYwZfGo+aw4EO8zWc=;
        b=czI1jojXSVv3djf+cysBxLezdC/boV7H9rilJNJTL2hxZOjRfZNOkmuIdbzOqkvbhU
         HooJnpFexvO1BotIDJUR4Woi/0USzcE1LnzTFFFJxf1fCrtZr4qrHShPt4wZl8n9cPZJ
         iDrWOvQA6R1MTPmIlwcjI8dZEO8I7i3US0aUg7wxUnSQu04bbSUz71gJ2f1Lh4TFLJf1
         8Ul6a/mci1jkjCmaxsDu5PAlU6OFjbgWb4vEIMT4W5OUI1kEyTIectUvF8pTeuiEZMqV
         7vznfS+NfW0R55p5AA1D8WSa+cw2MTLqUeMcLTBOZTbrJOfAEjnZ5uqvoA2FaSXn02/A
         lZbQ==
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: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=x8jlP9cFSpeN+6gFZhxS6K79lSVYwZfGo+aw4EO8zWc=;
        b=cxy5vVob73VyXVvjSQLXy/YzsCsLEXcmUTCa/+AV0jhw+TgHXoLwPhvF8SXqyUxRwi
         bOoAL9YnMDZPsEd0G1jsvUrWNnRou1+LbKRjI8Lnv05gvKPL9ZkZSimTTvi0OGKYHuiC
         /doOpS07VQx/576DIvgRfeJJUDoOtwnmCMDk55upEXrjWBNnqCUMwN25D6BeT3vN+qIM
         WXdOjWBKemDK3h+TDUAvdaaak8zBMWSDz5vUCDfQxh1hBNHROorZqzI21gvSXjWRcubl
         VJHeGTkBwj44yra5R8XxRTVlmuxGvejfwt6azjCRWF3p6J6Sy35QYlJWYMHZUKGdUPn8
         R3Ag==
X-Gm-Message-State: AN3rC/65zVsCAK8SYxlI1mdspKUKDbN7MV4lgXOzppJwSb7lYS8vkCoP
	S1VpG5B0zAqmMw==
X-Received: by 10.13.232.78 with SMTP id r75mr1647102ywe.53.1492620316799;
        Wed, 19 Apr 2017 09:45:16 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.60.44 with SMTP id q41ls3733939otc.20.gmail; Wed, 19 Apr
 2017 09:45:16 -0700 (PDT)
X-Received: by 10.157.15.205 with SMTP id m13mr84030otd.18.1492620316000;
        Wed, 19 Apr 2017 09:45:16 -0700 (PDT)
In-Reply-To: <dfb9f65c-ea1d-e92b-85e0-333efed1aec5@scylladb.com>
X-Original-Sender: rodrigojose690@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:32119
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32119>

------=_Part_2727_308742628.1492620315571
Content-Type: multipart/alternative; 
	boundary="----=_Part_2728_1204495269.1492620315571"

------=_Part_2728_1204495269.1492620315571
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/pSHhUp0-=
7so

Em domingo, 26 de mar=C3=A7o de 2017 11:30:29 UTC-3, Avi Kivity escreveu:
>
> Consider this type-safe bool class:=20
>
>
>    template <typename Tag>=20
>
>    class bool_class {=20
>
>        bool _value;=20
>
>    public:=20
>
>        explicit constexpr bool_class(bool v) noexcept : _value(v) {}=20
>
>        // more emulation of bool=20
>
>        static constexpr bool_class yes =3D bool_class{true};=20
>
>        static constexpr bool_class no =3D bool_class{true};=20
>
>    };=20
>
>
> Compilation fails, I believe rightly, on clang, because by the time yes=
=20
> and no are parsed, bool_class is an incomplete type, and therefore not a=
=20
> literal type.  It could be worked around by making yes and no functions.=
=20
>
> Should we make this legal?  It seems reasonable for types to offer=20
> constants scoped under their own name, and if they are literal types,=20
> that these constants can be constexpr.=20
>

--=20
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 e=
mail 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/61acd2a4-d2f8-41ef-849a-0c47cee485d1%40isocpp.or=
g.

------=_Part_2728_1204495269.1492620315571
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">https://groups.google.com/a/isocpp.org/forum/#!topic/std-p=
roposals/pSHhUp0-7so<br><br>Em domingo, 26 de mar=C3=A7o de 2017 11:30:29 U=
TC-3, Avi Kivity  escreveu:<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Con=
sider this type-safe bool class:
<br>
<br>
<br>=C2=A0 =C2=A0template &lt;typename Tag&gt;
<br>
<br>=C2=A0 =C2=A0class bool_class {
<br>
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0bool _value;
<br>
<br>=C2=A0 =C2=A0public:
<br>
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0explicit constexpr bool_class(bool v) noexce=
pt : _value(v) {}
<br>
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0// more emulation of bool
<br>
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0static constexpr bool_class yes =3D bool_cla=
ss{true};
<br>
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0static constexpr bool_class no =3D bool_clas=
s{true};
<br>
<br>=C2=A0 =C2=A0};
<br>
<br>
<br>Compilation fails, I believe rightly, on clang, because by the time yes=
=20
<br>and no are parsed, bool_class is an incomplete type, and therefore not =
a=20
<br>literal type. =C2=A0It could be worked around by making yes and no func=
tions.
<br>
<br>Should we make this legal? =C2=A0It seems reasonable for types to offer=
=20
<br>constants scoped under their own name, and if they are literal types,=
=20
<br>that these constants can be constexpr.
<br></blockquote></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/61acd2a4-d2f8-41ef-849a-0c47cee485d1%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/61acd2a4-d2f8-41ef-849a-0c47cee485d1=
%40isocpp.org</a>.<br />

------=_Part_2728_1204495269.1492620315571--

------=_Part_2727_308742628.1492620315571--

.
