220 29565 <CAJwqTS9XiyDK+7wWCRTCTjcnFnKQk6WudsrRTidgf4Ygoc0yng@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Peet Nick <peetnick2@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: "A Proposal to Relax Constexpr Restrictions for
 some Reinterpret Casts" ?
Date: Mon, 28 Nov 2016 23:04:39 +0100
Lines: 158
Approved: news@gmane.org
Message-ID: <CAJwqTS9XiyDK+7wWCRTCTjcnFnKQk6WudsrRTidgf4Ygoc0yng@mail.gmail.com>
References: <afbaf79e-305d-4408-98ab-5b35cfb11f27@isocpp.org> <CALnjya_VWQUMYGGd9tYy_cJWiwvsyUF2joMuCMPsPy=T6e15XA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e0102e15e7dd374054263a876
X-Trace: blaine.gmane.org 1480370682 29835 195.159.176.226 (28 Nov 2016 22:04:42 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 28 Nov 2016 22:04:42 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDS5DQNDSALBB6GT6LAQKGQE4CFQKEY@isocpp.org Mon Nov 28 23:04:38 2016
Return-path: <std-proposals+bncBDS5DQNDSALBB6GT6LAQKGQE4CFQKEY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f72.google.com ([209.85.215.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDS5DQNDSALBB6GT6LAQKGQE4CFQKEY@isocpp.org>)
	id 1cBU2P-0007GP-Lo
	for gclcip-std-proposals@m.gmane.org; Mon, 28 Nov 2016 23:04:37 +0100
Original-Received: by mail-lf0-f72.google.com with SMTP id o20sf59693660lfg.2
        for <gclcip-std-proposals@m.gmane.org>; Mon, 28 Nov 2016 14:04:41 -0800 (PST)
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=e30kuwWs0M3V6H//f+BnqW/pVgyaC4y+euVe9tMERa4=;
        b=nNd/1Ixa40+K6AmQue0FicWvDX0svIWzvVv4qSGEKiinSFIB2n4Cohg0C07R5ZRQWy
         Pf45Sf2M1kxbldLoI3lUsPvezhLKiIn8p2328qCsVNewk7dlQm13g8dD1MiVD0igSHXO
         bjxwrOEj5Od+pF7g6yDJPTttpIXq/lc9AOo0LibEYBtaloEMGO/IdvqoHFSrv7ckhJGd
         m/GCe7AjAHBu5ONINIHR4a5elPuvCirchoD2MaaVNTKWeAg9O/vWQFCj1rnOHrJoXocX
         3Ng4A9bB7UMf8+eLbispf7e/FkpBwMjzFD4rmmfDi0b+JYYRUczvYRdmDadPuHjGGTxO
         0zGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        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=e30kuwWs0M3V6H//f+BnqW/pVgyaC4y+euVe9tMERa4=;
        b=Gg8MOCUjoGeIOqybb5IVglQiFO++AjOU+CuShkTohhcmuYhNC+t7yHcpHuS0Ivm6k2
         hOum2b1H6iFj/DNjZL5x1OWlTMbRXc5DUG7xoe26EG68OpmwpeXXl68tG0z/yykixuju
         tSfbaNK65CPsjj0ZiW+Prm/2YuAcDbB4045bVErxnQoGh5/9Zvykh+W7IadvbJMKLB5d
         GznoOGN9hwPw27JPBzArlNo8NAOnlb9xaX+a7QA8iepMv3zxtMXi0UUw9Gip+TR67SSG
         1aE5YTRWJcPpnHL3fSRQL2OV73D2aAcqvjTr91R1qEtf2GN+HmV4ZgLC5xtu4o0zV4PU
         BorQ==
X-Gm-Message-State: AKaTC01IoznpmcTVXeXlajibbJ90/7D9bQwsJ1NVz9zUzHVxO6qP6EdunR9G2ysz0AdXLg==
X-Received: by 10.46.33.167 with SMTP id h39mr3718928lji.29.1480370681682;
        Mon, 28 Nov 2016 14:04:41 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.157.71 with SMTP id g68ls2644336wme.27.canary-gmail; Mon,
 28 Nov 2016 14:04:40 -0800 (PST)
X-Received: by 10.28.150.75 with SMTP id y72mr22460019wmd.47.1480370680186;
        Mon, 28 Nov 2016 14:04:40 -0800 (PST)
Original-Received: from mail-wj0-x241.google.com (mail-wj0-x241.google.com. [2a00:1450:400c:c01::241])
        by mx.google.com with ESMTPS id i2si56435638wjw.89.2016.11.28.14.04.40
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 28 Nov 2016 14:04:40 -0800 (PST)
Received-SPF: pass (google.com: domain of peetnick2@gmail.com designates 2a00:1450:400c:c01::241 as permitted sender) client-ip=2a00:1450:400c:c01::241;
Original-Received: by mail-wj0-x241.google.com with SMTP id jb2so15852216wjb.3
        for <std-proposals@isocpp.org>; Mon, 28 Nov 2016 14:04:40 -0800 (PST)
X-Received: by 10.194.103.100 with SMTP id fv4mr20873280wjb.102.1480370679565;
 Mon, 28 Nov 2016 14:04:39 -0800 (PST)
Original-Received: by 10.80.159.78 with HTTP; Mon, 28 Nov 2016 14:04:39 -0800 (PST)
In-Reply-To: <CALnjya_VWQUMYGGd9tYy_cJWiwvsyUF2joMuCMPsPy=T6e15XA@mail.gmail.com>
X-Original-Sender: peetnick2@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 peetnick2@gmail.com designates 2a00:1450:400c:c01::241 as permitted sender)
 smtp.mailfrom=peetnick2@gmail.com;       dmarc=pass (p=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:29565
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29565>

--089e0102e15e7dd374054263a876
Content-Type: text/plain; charset=UTF-8

I am not sure how that would help? The destination type must have the same
size as the source type, how would that help me getting the "raw byte view"
of an scalar/pod?

On Fri, Nov 25, 2016 at 4:32 PM, Mathias Gaunard <mathias@gaunard.com>
wrote:

> I think you would have better luck with the new function bit_cast which
> might end up being constexpr.
>
> On 25 November 2016 at 11:32, Peet <peetnick2@gmail.com> wrote:
>
>> Hello,
>>
>> I was basically trying to implement a hash function in C++ using constant
>> expressions (constexpr).
>> Sometimes it is necessary to cast a scalar type (or arrays) to cv
>> unsigned/signed char* to simply get the bytes and do some calculation.
>> Although it seems that reinterpret_casts aren't allowed in constexpr
>> (5.20/2.14).
>> Quickly googling this issue got me to this proposal: "A Proposal to Relax
>> Constexpr Restrictions for some Reinterpret Casts" by Antony Polukhin [1].
>> This proposal relaxes the rule for reinterpret_cast in constexpr so that
>> we can actually cast cv void* to cv unsigned/signed char*.
>> Although I couldn't find any discussions about this online, also it seems
>> that the proposal hasn't been sent to the openstd mailing-list.
>> Does anyone know if this proposal is still "alive" and if this is being
>> considered proposing?
>>
>> Regards,
>> Nick
>>
>> [1] https://apolukhin.github.io/constexpr_algorithms/reinterpret.html
>>
>> --
>> 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/is
>> ocpp.org/d/msgid/std-proposals/afbaf79e-305d-4408-98ab-
>> 5b35cfb11f27%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/afbaf79e-305d-4408-98ab-5b35cfb11f27%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
>
> --
> 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/CALnjya_VWQUMYGGd9tYy_
> cJWiwvsyUF2joMuCMPsPy%3DT6e15XA%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALnjya_VWQUMYGGd9tYy_cJWiwvsyUF2joMuCMPsPy%3DT6e15XA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAJwqTS9XiyDK%2B7wWCRTCTjcnFnKQk6WudsrRTidgf4Ygoc0yng%40mail.gmail.com.

--089e0102e15e7dd374054263a876
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I am not sure how that would help? The destination type mu=
st have the same size as the source type, how would that help me getting th=
e &quot;raw byte view&quot; of an scalar/pod?</div><div class=3D"gmail_extr=
a"><br><div class=3D"gmail_quote">On Fri, Nov 25, 2016 at 4:32 PM, Mathias =
Gaunard <span dir=3D"ltr">&lt;<a href=3D"mailto:mathias@gaunard.com" target=
=3D"_blank">mathias@gaunard.com</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr">I think you would have better luck with the =
new function bit_cast which might end up being constexpr.</div><div><div cl=
ass=3D"h5"><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On 25 =
November 2016 at 11:32, Peet <span dir=3D"ltr">&lt;<a href=3D"mailto:peetni=
ck2@gmail.com" target=3D"_blank">peetnick2@gmail.com</a>&gt;</span> wrote:<=
br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left=
:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hello,<div><br></div><di=
v>I was basically trying to implement a hash function in C++ using constant=
 expressions (constexpr).</div><div>Sometimes it is necessary to cast a sca=
lar type (or arrays) to cv unsigned/signed char* to simply get the bytes an=
d do some calculation.</div><div>Although it seems that reinterpret_casts a=
ren&#39;t allowed in constexpr (5.20/2.14).</div><div>Quickly googling this=
 issue got me to this proposal:=C2=A0&quot;A Proposal to Relax Constexpr Re=
strictions for some Reinterpret Casts&quot; by=C2=A0Antony Polukhin [1].</d=
iv><div>This proposal relaxes the rule for reinterpret_cast in constexpr so=
 that we can actually cast cv void* to cv unsigned/signed char*.</div><div>=
Although I couldn&#39;t find any discussions about this online, also it see=
ms that the proposal hasn&#39;t been sent to the openstd mailing-list.</div=
><div>Does anyone know if this proposal is still &quot;alive&quot; and if t=
his is being considered proposing?</div><div><br></div><div>Regards,</div><=
div>Nick</div><div><br></div><div>[1]=C2=A0<a href=3D"https://apolukhin.git=
hub.io/constexpr_algorithms/reinterpret.html" target=3D"_blank">https://apo=
lukhin.github.i<wbr>o/constexpr_algorithms/reinter<wbr>pret.html</a></div><=
/div><span class=3D"m_304883840893532982HOEnZb"><font color=3D"#888888">

<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" target=3D"_=
blank">std-proposals+unsubscribe@isoc<wbr>pp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">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/afbaf79e-305d-4408-98ab-5b35cfb11f27%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/is<wbr>ocpp.org/d/msgid/std-proposals<wbr>/afba=
f79e-305d-4408-98ab-<wbr>5b35cfb11f27%40isocpp.org</a>.<br>
</font></span></blockquote></div><br></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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></div></div>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CALnjya_VWQUMYGGd9tYy_cJWiwvsyUF2joMu=
CMPsPy%3DT6e15XA%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfoote=
r" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/msgid/st=
d-<wbr>proposals/CALnjya_<wbr>VWQUMYGGd9tYy_<wbr>cJWiwvsyUF2joMuCMPsPy%<wbr=
>3DT6e15XA%40mail.gmail.com</a>.<br>
</blockquote></div><br></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/CAJwqTS9XiyDK%2B7wWCRTCTjcnFnKQk6Wuds=
rRTidgf4Ygoc0yng%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAJwqTS9XiyDK%2=
B7wWCRTCTjcnFnKQk6WudsrRTidgf4Ygoc0yng%40mail.gmail.com</a>.<br />

--089e0102e15e7dd374054263a876--

.
