Bug 161719 - bitwise_cast: allow const destination type
Summary: bitwise_cast: allow const destination type
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: JF Bastien
Depends on:
Reported: 2016-09-07 16:47 PDT by JF Bastien
Modified: 2016-09-07 17:42 PDT (History)
5 users (show)

See Also:

patch (1.50 KB, patch)
2016-09-07 16:49 PDT, JF Bastien
no flags Details | Formatted Diff | Diff
patch (1.50 KB, patch)
2016-09-07 17:03 PDT, JF Bastien
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description JF Bastien 2016-09-07 16:47:04 PDT
I was playing around with a bitwise_cast that could be added to the C++ standard (separate implementation and tests from WTF's), and this should be made to work:
  const To to = bitwise_cast<const To>(from);

It's not super useful, but can happen when template-galore hits.
Comment 1 JF Bastien 2016-09-07 16:49:15 PDT
Created attachment 288205 [details]
Comment 2 WebKit Commit Bot 2016-09-07 16:50:40 PDT
Attachment 288205 [details] did not pass style-queue:

ERROR: Source/WTF/wtf/StdLibExtras.h:154:  Missing space before {  [whitespace/braces] [5]
Total errors found: 1 in 2 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 JF Bastien 2016-09-07 17:03:18 PDT
Created attachment 288208 [details]

Fix style.
Comment 4 WebKit Commit Bot 2016-09-07 17:42:17 PDT
Comment on attachment 288208 [details]

Clearing flags on attachment: 288208

Committed r205577: <http://trac.webkit.org/changeset/205577>
Comment 5 WebKit Commit Bot 2016-09-07 17:42:21 PDT
All reviewed patches have been landed.  Closing bug.