<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1857</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="1857"></A><H4>1857.
  
Additional questions about bits
</H4>
<B>Section: </B>7.6.7&#160; [<A href="https://wg21.link/expr.shift">expr.shift</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD5
 &#160;&#160;&#160;

 <B>Submitter: </B>Tony Van Eerd
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-12<BR>


<P>[Adopted at the November, 2018 meeting as part of paper P1236R1.]</P>



<P>The resolution of <A HREF="1796.html">issue 1796</A> addressed
only the relationship of &#8220;bits&#8221; with the null character
value.  The values and arrangements of bits within an object are also
mentioned in other contexts; these should also be considered for
revision.  For example, 7.6.7 [<A href="https://wg21.link/expr.shift#2">expr.shift</A>] paragraph 2 says,</P>

<BLOCKQUOTE>

The value of <TT>E1 &lt;&lt; E2</TT> is <TT>E1</TT>
left-shifted <TT>E2</TT> bit positions; vacated bits are zero-filled.

</BLOCKQUOTE>

<P>This appears to place constraints on the bit representation, which
(as noted in <A HREF="1796.html">issue 1796</A>) is not accessible
to the program.  A similar statement appears in paragraph 3 for
<TT>&gt;&gt;</TT>.</P>

<P>The specification of the bitwise operations in 7.6.11 [<A href="https://wg21.link/expr.bit.and">expr.bit.and</A>],
7.6.12 [<A href="https://wg21.link/expr.xor">expr.xor</A>], and 7.6.13 [<A href="https://wg21.link/expr.or">expr.or</A>] uses the undefined
term &#8220;bitwise&#8221; in describing the operations, without specifying
whether it is the value or object representation that is in view.</P>

<P>Part of the resolution of this might be to define &#8220;bit&#8221;
(which is otherwise currently undefined in C++) as a value of a given
power of 2.</P>

<P><B>Notes from the June, 2014 meeting:</B></P>

<P>CWG decided to reformulate the description of the operations
themselves to avoid references to bits, splitting off the larger
questions of defining &#8220;bit&#8221; and the like to
<A HREF="1943.html">issue 1943</A> for further
consideration.</P>

<BR><BR>
</BODY>
</HTML>
