220 31756 <CAFk2RUa1uC+tvkBBYevwNFo=h-oW7UXyBFXbnfoqmCAWFTEfOw@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Allow constexpr static data members in a literal type.
Date: Sun, 26 Mar 2017 17:35:39 +0300
Lines: 43
Approved: news@gmane.org
Message-ID: <CAFk2RUa1uC+tvkBBYevwNFo=h-oW7UXyBFXbnfoqmCAWFTEfOw@mail.gmail.com>
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: text/plain; charset=UTF-8
X-Trace: blaine.gmane.org 1490538952 27663 195.159.176.226 (26 Mar 2017 14:35:52 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 26 Mar 2017 14:35:52 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5JHI7A7ALRBPFD37DAKGQEMMRXJ2I@isocpp.org Sun Mar 26 16:35:43 2017
Return-path: <std-proposals+bncBC5JHI7A7ALRBPFD37DAKGQEMMRXJ2I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ot0-f197.google.com ([74.125.82.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBPFD37DAKGQEMMRXJ2I@isocpp.org>)
	id 1cs9GZ-0005Yf-6l
	for gclcip-std-proposals@m.gmane.org; Sun, 26 Mar 2017 16:35:35 +0200
Original-Received: by mail-ot0-f197.google.com with SMTP id 102sf13865644otv.1
        for <gclcip-std-proposals@m.gmane.org>; Sun, 26 Mar 2017 07:35:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :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=ov9YaZi6OaObZK39e1MMAD16AMO3F7+QzDYKFl6FKOk=;
        b=mAK9rk5w0x55Z3qLBdFuDLUSZ4kpaThvMFMOaGiZnkK3VP9jMpjWA/iL5/PNDE3FG6
         VDonCsiOa4X2wYayeBs//8aPuS0WYKZ6WoqPHGFaFAM491qht6M/zTukib9+7fqD5bTz
         3XVBK0hdePkM+ISCgDtRVC0buPwdSVC54bAkAiAyOBadjFwcq5hpGzIbq5yFtDTOZZj8
         4zzZPYCSu15pdzvkZj91acLPzgJjyC2OJXurEyzG1o6Rz2uG9kM5Pvb7UE/GzFZQIwFm
         5Wtp79JSRphq92YIU9lrDrOy72xYg9aq3ZSs/3yCRpM40LGSq1IhQnSfdstkIZkeNebi
         vXEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to: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=ov9YaZi6OaObZK39e1MMAD16AMO3F7+QzDYKFl6FKOk=;
        b=I2fvNwsx9RZTXnu/Gy5ZIaTavqLHfteHpMDUKhCgunhqlNpGeboOKzCcbfstFYOi5x
         gtp+6CeR8zQe37wmbLcgR7u9D8iiEmrSFsCKRtGqV0oktmKKmLz1avAPIC+DcLXxPAVS
         oNT3JNeOYc1ZXQKTUFjbFST6agjhqv8gIrue8UdNAc59/hgBYLBmwnSnaFaVhVoxo90m
         6T3mVssU0/XcDzslOkrvInlOcXufaM5cfo1q0/y8iSTmlILDzPQpTS11E1djVwxuj48J
         ft0C9XmzgHszolxlnIdLpFKF0Ti3u3TIFZcDwahJ5ZbvexeOI4oRP5G/hf/ZgTqx3wyt
         m11Q==
X-Gm-Message-State: AFeK/H3GArahGr1AT6anx79j10SHl5szhjGAFdlBk5/cfNDqOJplV+EVtGy1LgaCAKOvxA==
X-Received: by 10.157.35.69 with SMTP id k5mr1690797otd.32.1490538940851;
        Sun, 26 Mar 2017 07:35:40 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.5.7 with SMTP id 7ls11965311otw.5.gmail; Sun, 26 Mar 2017
 07:35:40 -0700 (PDT)
X-Received: by 10.202.85.209 with SMTP id j200mr2090606oib.192.1490538940323;
        Sun, 26 Mar 2017 07:35:40 -0700 (PDT)
Original-Received: from mail-ot0-x235.google.com (mail-ot0-x235.google.com. [2607:f8b0:4003:c0f::235])
        by mx.google.com with ESMTPS id v188si4107674oib.107.2017.03.26.07.35.40
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 26 Mar 2017 07:35:40 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:4003:c0f::235 as permitted sender) client-ip=2607:f8b0:4003:c0f::235;
Original-Received: by mail-ot0-x235.google.com with SMTP id y88so16851341ota.2
        for <std-proposals@isocpp.org>; Sun, 26 Mar 2017 07:35:40 -0700 (PDT)
X-Received: by 10.157.58.68 with SMTP id j62mr9092896otc.145.1490538939990;
 Sun, 26 Mar 2017 07:35:39 -0700 (PDT)
Original-Received: by 10.157.13.22 with HTTP; Sun, 26 Mar 2017 07:35:39 -0700 (PDT)
In-Reply-To: <dfb9f65c-ea1d-e92b-85e0-333efed1aec5@scylladb.com>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 ville.voutilainen@gmail.com designates 2607:f8b0:4003:c0f::235 as permitted
 sender) smtp.mailfrom=ville.voutilainen@gmail.com;       dmarc=pass (p=NONE
 sp=NONE dis=NONE) header.from=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:31756
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31756>

On 26 March 2017 at 17:30, Avi Kivity <avi@scylladb.com> wrote:
> Consider this type-safe bool class:
>
>
>   template <typename Tag>
>
>   class bool_class {
>
>       bool _value;
>
>   public:
>
>       explicit constexpr bool_class(bool v) noexcept : _value(v) {}
>
>       // more emulation of bool
>
>       static constexpr bool_class yes = bool_class{true};
>
>       static constexpr bool_class no = bool_class{true};
>
>   };
>
>
> Compilation fails, I believe rightly, on clang, because by the time yes and
> no are parsed, bool_class is an incomplete type, and therefore not a literal
> type.  It could be worked around by making yes and no functions.
>
> Should we make this legal?  It seems reasonable for types to offer constants
> scoped under their own name, and if they are literal types, that these
> constants can be constexpr.


This is US 24 in
http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0488r0.pdf. The
comment was rejected
for C++17 due to lack of a proper proposal and the timing.

-- 
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/CAFk2RUa1uC%2BtvkBBYevwNFo%3Dh-oW7UXyBFXbnfoqmCAWFTEfOw%40mail.gmail.com.

.
