220 29627 <569dee8e-b869-40e0-9b41-1d1f39fecb12@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Myriachan <myriachan@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: "A Proposal to Relax Constexpr Restrictions for
 some Reinterpret Casts" ?
Date: Fri, 2 Dec 2016 17:32:34 -0800 (PST)
Lines: 79
Approved: news@gmane.org
Message-ID: <569dee8e-b869-40e0-9b41-1d1f39fecb12@isocpp.org>
References: <afbaf79e-305d-4408-98ab-5b35cfb11f27@isocpp.org>
 <CALnjya_VWQUMYGGd9tYy_cJWiwvsyUF2joMuCMPsPy=T6e15XA@mail.gmail.com>
 <CAJwqTS9XiyDK+7wWCRTCTjcnFnKQk6WudsrRTidgf4Ygoc0yng@mail.gmail.com>
 <14dc989b-7a2f-478b-b16e-b9297fb1782f@isocpp.org> <CAJwqTS_OGEOUiUE6rSRrREV6Yx9+4Sj5gA8CDHeYgXnPwErW6Q@mail.gmail.com>
 <CAJnLdOaJRPtdnHPX0=L89Pip2GC90aXrEYtJdUYxaHw1vwNJ=w@mail.gmail.com>
 <CAOfiQqk4ce1==kUKZYH3ZLUVKMAG94vpQoYu9Bhh3Mc_zC7=eg@mail.gmail.com>
 <591447c7-38cd-4ad4-83aa-fc1326c1829e@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2085_10541132.1480728754340"
X-Trace: blaine.gmane.org 1480728757 19143 195.159.176.226 (3 Dec 2016 01:32:37 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 3 Dec 2016 01:32:37 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDKLT4PURQHRBM6BRDBAKGQEWPCEZSY@isocpp.org Sat Dec 03 02:32:33 2016
Return-path: <std-proposals+bncBDKLT4PURQHRBM6BRDBAKGQEWPCEZSY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f199.google.com ([209.85.213.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDKLT4PURQHRBM6BRDBAKGQEWPCEZSY@isocpp.org>)
	id 1cCzBn-0003we-Uq
	for gclcip-std-proposals@m.gmane.org; Sat, 03 Dec 2016 02:32:32 +0100
Original-Received: by mail-yb0-f199.google.com with SMTP id 126sf267059910ybo.4
        for <gclcip-std-proposals@m.gmane.org>; Fri, 02 Dec 2016 17:32:36 -0800 (PST)
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=+13YOKuo0uHlHLFUvoqAzwJrBYQtlumKFjldqclXpxs=;
        b=LFRBt+kc2wM+iXMIikAEdK4tZ9Ze1ZWVgqmtVG8uTzJ+quujhRvx39MuWDPDHhvfr2
         za0RaXywYkaqjYWM556R0IcTWjdbrwQHFbLhW+9ou9Jx4m4+OgK06yJ49A+RZabikhsw
         6Oz25HtFfeqCoLNjF0kAV5qbOc9uipK+t3ZBwbKw35bIfSwBHLzANq+okqf8/m1lFsEa
         tI0C4WoqAZLYsuuuxw+vdzW8MkKsAuiR3OGas5p5b63F+O0tp0/+RaUwdGlYpsw7Wqgs
         CMyC4W6SXQMTGNdcuD5A6iHj2MIV7ILWkcXo6pjkJG+rlayqxUI+A0z71xOgPkECu+An
         7R5w==
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=+13YOKuo0uHlHLFUvoqAzwJrBYQtlumKFjldqclXpxs=;
        b=sY4djwegkDrRu2Su2gv1CRB+qZsxNZ+nywgjXhyazEBPgigv/mupyO5AmHFphcAlNZ
         DXI33Gv5sm4mYjtXaTse4Ex0N2FzppwaRD6Uitnmv6z+SAcnVNZ6yM/ZFqYMzeMnT6Vm
         56x08yYcFJ0aJ9OHl1pTRD+0+931/XhKYH87SynrshqQjhc1nSRtfAarNcPn1pG8s9ka
         LL67ZxRqKG0Pgza3NYW84QqcD5MfJmF9CpqUtRWzfuVjwR/wsi1eL0w7onm9tRa9nyZ3
         rdxyq33vfnFRjFDr2R5rZB1CzMvSmgfBzxS4/mCh9Gfv3Nm/2ZVlFkOOz6J/53AgoLYc
         qTiQ==
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=+13YOKuo0uHlHLFUvoqAzwJrBYQtlumKFjldqclXpxs=;
        b=LKey8qY9JKHlehjAoc8JbFRpVIlM+XDLkXAJROUKKxINf9ebV0Jf5f4251KI5fkEXn
         0oR3baHFBPI5erCD/RXVy97/XSkWslx6k/uyIaZ061XM4OzJujEqEaqRBImb41JG8a9L
         KpuWM+B0gc9N5mTJHl2TD0auEF63yuyVaDqxZ7BaRX7EJ0GycMqATBw1Mef+5l8jDLsl
         G1aNK2jGUJSdMty43bAxH8m21A8gfbO9dY9f1KSe7km8QWbXLGlHWwP6UgCcKtI/JPZe
         y1+tVeE7CT7SQFJqcHaGYOOZzjIwYF5LXFwUoVRlqvCU/miQGzsJUiCRlAquSs+IC09l
         sPQA==
X-Gm-Message-State: AKaTC01SrrNtEK4SYiVtIFCFypgaYtoQ9Tpbb7qL4aJPzul26U4zZB7LexqrpIgKOvYUyQ==
X-Received: by 10.129.168.68 with SMTP id f65mr11727381ywh.49.1480728755705;
        Fri, 02 Dec 2016 17:32:35 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.52.220 with SMTP id t28ls10424266otd.3.gmail; Fri, 02 Dec
 2016 17:32:35 -0800 (PST)
X-Received: by 10.157.18.211 with SMTP id g77mr3244131otg.14.1480728754982;
        Fri, 02 Dec 2016 17:32:34 -0800 (PST)
In-Reply-To: <591447c7-38cd-4ad4-83aa-fc1326c1829e@isocpp.org>
X-Original-Sender: myriachan@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:29627
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29627>

------=_Part_2085_10541132.1480728754340
Content-Type: multipart/alternative; 
	boundary="----=_Part_2086_1171094534.1480728754340"

------=_Part_2086_1171094534.1480728754340
Content-Type: text/plain; charset=UTF-8

On Monday, November 28, 2016 at 6:07:57 PM UTC-8, Nicol Bolas wrote:
>
> This is *precisely* why `bit_cast` is a good thing. Because it's a 
> function which knows both the source and destination types, we would be 
> able to say that it is `constexpr` when doing certain conversions and not 
> `constexpr` when doing others. For example, any conversion of a pointer to 
> anything other than a pointer would not be `constexpr`. This would include 
> within various types, so you couldn't have a `struct{int *p};` that you 
> `bit_cast` to a `struct{intptr_t q};`.
>
> The OP asked specifically about converting integers to their 
> bit-representation to do hashing and so forth. `bit_cast` could be 
> `constexpr` for such operations.
>
> So there's no problem.
>

As far as I can tell, constexpr bit_cast would be useful for implementing 
things that'd otherwise require direct compiler support, such as 
std::numeric_limits<float>::infinity().  Am I right in this assumption?

Melissa

-- 
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/569dee8e-b869-40e0-9b41-1d1f39fecb12%40isocpp.org.

------=_Part_2086_1171094534.1480728754340
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, November 28, 2016 at 6:07:57 PM UTC-8, Nicol Bo=
las wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">Thi=
s is <i>precisely</i> why `bit_cast` is a good thing. Because it&#39;s a fu=
nction which knows both the source and destination types, we would be able =
to say that it is `constexpr` when doing=20
certain conversions and not `constexpr` when doing others. For example,=20
any conversion of a pointer to anything other than a pointer would not=20
be `constexpr`. This would include within various types, so you couldn&#39;=
t
 have a `struct{int *p};` that you `bit_cast` to a `struct{intptr_t=20
q};`.<br><div><br>The OP asked specifically about converting integers to=20
their bit-representation to do hashing and so forth. `bit_cast` could be
 `constexpr` for such operations.<br><br>So there&#39;s no problem.<br></di=
v></div></blockquote><div><br>As far as I can tell, constexpr bit_cast woul=
d be useful for implementing things that&#39;d otherwise require direct com=
piler support, such as std::numeric_limits&lt;float&gt;::infinity().=C2=A0 =
Am I right in this assumption?<br><br>Melissa<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/569dee8e-b869-40e0-9b41-1d1f39fecb12%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/569dee8e-b869-40e0-9b41-1d1f39fecb12=
%40isocpp.org</a>.<br />

------=_Part_2086_1171094534.1480728754340--

------=_Part_2085_10541132.1480728754340--

.
