<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 342</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="342"></A><H4>342.
  
Terminology: "indirection" versus "dereference"
</H4>
<B>Section: </B>7.6.2&#160; [<A href="https://wg21.link/expr.unary">expr.unary</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Jason Merrill
 &#160;&#160;&#160;

 <B>Date: </B>7 Oct 2001<BR>


<P>[Moved to DR at the October, 2012 meeting.]</P>



<P>Split off from <A HREF="315.html">issue 315</A>.</P>

<P>Incidentally, another thing that ought to be cleaned up is the inconsistent
use of "indirection" and "dereference".  We should pick one.</P>

<P><B>Proposed resolution (December, 2006):</B></P>

<OL>

<LI><P>Change 7.6.2.2 [<A href="https://wg21.link/expr.unary.op#1">expr.unary.op</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

The unary <TT>*</TT>
operator <DEL>performs <I>indirection</I></DEL> <INS>dereferences a pointer
value</INS>: the expression to which it is applied shall be a pointer...

</BLOCKQUOTE>

<LI><P>Change 9.3.4.5 [<A href="https://wg21.link/dcl.array#8">dcl.array</A>] paragraph 8 as follows:</P></LI>

<BLOCKQUOTE>

The <DEL>results are added and indirection applied</DEL> <INS>values are
added and the result is dereferenced</INS> to yield an array (of five
integers), which in turn is converted to a pointer to the first of the
integers.

</BLOCKQUOTE>

<LI><P>Change 9.3.4.6 [<A href="https://wg21.link/dcl.fct#9">dcl.fct</A>] paragraph 9 as follows:</P></LI>

<BLOCKQUOTE>

The binding of <TT>*fpi(int)</TT> is <TT>*(fpi(int))</TT>, so the
declaration suggests, and the same construction in an expression
requires, the calling of a function <TT>fpi</TT>, and then <DEL>using
indirection through</DEL> <INS>dereferencing</INS> the (pointer) result
to yield an integer. In the declarator <TT>(*pif)(const char*, const
char*)</TT>, the extra parentheses are necessary to indicate that
<DEL>indirection through</DEL> <INS>dereferencing</INS> a pointer to a
function yields a function, which is then called.

</BLOCKQUOTE>

<LI><P>Change the index for <TT>*</TT> and &#8220;dereferencing&#8221;
no longer to refer to &#8220;indirection.&#8221;</P></LI>

</OL>

<P>[<I>Drafting note:</I> 29.6.9 [<A href="https://wg21.link/template.indirect.array">template.indirect.array</A>]
requires no change.  Many more places in the current wording use
&#8220;dereferencing&#8221; than &#8220;indirection.&#8221;]</P>

<P><B>Notes from the August, 2011 meeting:</B></P>

<P>CWG prefers use of the term &#8220;indirection&#8221; instead of
&#8220;dereferencing.&#8221; This would be consistent with the usage
in the C Standard and would avoid entanglement with the C++ concept
of a reference type.</P>

<P><B>Proposed resolution (February, 2012):</B></P>

<OL>
<LI><P>Change 6.8.6.5.2 [<A href="https://wg21.link/basic.stc.dynamic.allocation#2">basic.stc.dynamic.allocation</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

...The effect of <DEL>dereferencing</DEL> <INS>indirecting
through</INS> a pointer returned as a request for zero size is
undefined.

</BLOCKQUOTE>

<LI><P>Change _N4885_6.7.5.5.4 [<A href="https://wg21.link/basic.stc.dynamic.safety#2">basic.stc.dynamic.safety</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

<UL>
<LI><P>the value returned by a call to the C ++ standard library
implementation of <TT>::operator new(std:: size_t)</TT>;
[<I>Footnote:</I> This section does not impose restrictions on
<DEL>dereferencing</DEL> <INS>indirection through</INS> pointers to
memory not allocated by <TT>::operator new</TT>.  This maintains the
ability of many C++ implementations to use binary libraries and
components written in other languages.  In particular, this applies to
C binaries, because <DEL>dereferencing</DEL> <INS>indirection
through</INS> pointers to memory allocated by
<TT><INS>std::</INS>malloc</TT> is not restricted. &#8212;<I>end
footnote</I>]</P></LI>

<LI><P>the result of taking the address of an object (or one of its
subobjects) designated by an lvalue resulting from
<DEL>dereferencing</DEL> <INS>indirection through</INS> a
safely-derived pointer value;</P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<LI><P>Change 6.8.4 [<A href="https://wg21.link/basic.life#5">basic.life</A>] paragraph 5 as follows:</P></LI>

<BLOCKQUOTE>

...<DEL>Such</DEL> <INS>Indirection through such</INS> a pointer
<DEL>may be dereferenced</DEL> <INS>is permitted</INS> but the
resulting lvalue may only be used in limited ways...

</BLOCKQUOTE>

<LI><P>Change 7.3.13 [<A href="https://wg21.link/conv.mem#2">conv.mem</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

...Since the result has type &#8220;pointer to member of <TT>D</TT> of
type <I>cv</I> <TT>T</TT>&#8221;, <DEL>it can be dereferenced</DEL>
<INS>indirection through it</INS> with a <TT>D</TT> object <INS>is
valid</INS>.  The result is the same as if <INS>indirecting
through</INS> the pointer to member of <TT>B</TT> <DEL>were
dereferenced</DEL> with the <TT>B</TT> subobject of <TT>D</TT>. The
null member pointer value...

</BLOCKQUOTE>

<LI><P>Change 7.6.1.9 [<A href="https://wg21.link/expr.static.cast#12">expr.static.cast</A>] paragraph 12 as follows:</P></LI>

<BLOCKQUOTE>

...[<I>Note:</I> although class <TT>B</TT> need not contain the
original member, the dynamic type of the object <DEL>on</DEL>
<INS>with</INS> which <INS>indirection through</INS> the pointer to
member is <DEL>dereferenced</DEL> <INS>performed</INS> must contain
the original member; see 7.6.4 [<A href="https://wg21.link/expr.mptr.oper">expr.mptr.oper</A>]. &#8212;<I>end
note</I>]

</BLOCKQUOTE>

<LI><P>Change 7.6.2.2 [<A href="https://wg21.link/expr.unary.op#1">expr.unary.op</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

...[<I>Note:</I> <INS>indirection through</INS> a pointer to an
incomplete type (other than <I>cv</I> <TT>void</TT>) <DEL>can be
dereferenced</DEL> <INS>is valid</INS>. The lvalue thus obtained...

</BLOCKQUOTE>

<LI><P>Change 7.6.10 [<A href="https://wg21.link/expr.eq#2">expr.eq</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

...Otherwise they compare equal if and only if they would refer to the
same member of the same most derived object (6.8.2 [<A href="https://wg21.link/intro.object">intro.object</A>])
or the same subobject if <DEL>they were dereferenced</DEL>
<INS>indirection</INS> with a hypothetical object of the associated
class type <INS>were performed</INS>. [<I>Example:</I>...

</BLOCKQUOTE>

<LI><P>Change 9.12 [<A href="https://wg21.link/dcl.link#8">dcl.link</A>] paragraph 8:</P></LI>

<BLOCKQUOTE>

[<I>Note:</I> Because the language linkage is part of a function type,
when <INS>indirecting through</INS> a pointer to C function <DEL>(for
example) is dereferenced</DEL>, the function to which <DEL>it</DEL>
<INS>the resulting lvalue</INS> refers is considered a C
function. &#8212;<I>end note</I>]

</BLOCKQUOTE>

<LI><P>Change 9.3.4.3 [<A href="https://wg21.link/dcl.ref#5">dcl.ref</A>] paragraph 5 as follows:</P></LI>

<BLOCKQUOTE>

...[<I>Note:</I> in particular, a null reference cannot exist in a
well-defined program, because the only way to create such a reference
would be to bind it to the &#8220;object&#8221; obtained by
<DEL>dereferencing</DEL> <INS>indirection through</INS> a null
pointer, which causes undefined behavior.  As described...

</BLOCKQUOTE>

<LI><P>Change 16.4.4.6 [<A href="https://wg21.link/allocator.requirements">allocator.requirements</A>] table 27:</P></LI>

<BLOCKQUOTE>

<TABLE border="2" frame="border" rules="rows">
<TR>
<TD align="center"><B>Variable</B></TD>
<TD align="center"><B>Definition</B></TD>
</TR>

<TR><TD colspan="2">...</TD></TR>

<TR>
<TD><B>c</B></TD>
<TD>a <DEL>dereferenceable</DEL> pointer of type <TT>C*</TT> <INS>through which indirection is valid</INS>
</TD>
</TR>

<TR><TD colspan="2">...</TD></TR>

</TABLE>

</BLOCKQUOTE>

<LI><P>Change 20.2.3.3 [<A href="https://wg21.link/pointer.traits.functions">pointer.traits.functions</A>] as follows:</P></LI>

<BLOCKQUOTE>

<I>Returns:</I> The first member function returns a
<DEL>dereferenceable</DEL> pointer to <TT>r</TT> obtained by calling
<TT>Ptr::pointer_to(r)</TT> <INS>through which indirection is
valid</INS>; an instantiation of this function is ill-formed...

</BLOCKQUOTE>

<LI><P>Change _N4885_.20.10.5 [<A href="https://wg21.link/util.dynamic.safety#10">util.dynamic.safety</A>] paragraph 10 as follows:</P></LI>

<BLOCKQUOTE>

<I>Effects:</I> The <TT>n</TT> bytes starting at <TT>p</TT> no longer
contain traceable pointer locations, independent of their type.  Hence
<DEL>pointers</DEL> <INS>indirection through a pointer</INS> located
there <DEL>may not be dereferenced</DEL> <INS>is undefined</INS> if
the object <DEL>they point</DEL> <INS>it points</INS> to was created
by global <TT>operator new</TT> and not previously declared
reachable...

</BLOCKQUOTE>

<LI><P>Change 26.11 [<A href="https://wg21.link/specialized.algorithms#1">specialized.algorithms</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

...is required to have the property that no exceptions are thrown from
increment, assignment, comparison, or <DEL>dereference of</DEL>
<INS>indirection through</INS> valid iterators...

</BLOCKQUOTE>

<LI><P>Change 28.3.4.6.2.3 [<A href="https://wg21.link/locale.time.get.virtuals#11">locale.time.get.virtuals</A>] paragraph 11 as follows:</P></LI>

<BLOCKQUOTE>

<I>Requires:</I> <TT>t</TT> shall <DEL>be dereferenceable</DEL>
<INS>point to an object</INS>.

</BLOCKQUOTE>

<LI><P>Change 23.4.3.2 [<A href="https://wg21.link/map.cons#3">map.cons</A>] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

<I>Requires:</I> If the iterator's <DEL>dereference</DEL>
<INS>indirection</INS> operator returns an lvalue or a const rvalue
<TT>pair&lt;key_type, mapped_type&gt;</TT>, then both
<TT>key_type</TT> and <TT>mapped_type</TT> shall be
<TT>CopyConstructible</TT>.

</BLOCKQUOTE>

<LI><P>Change 23.4.4.2 [<A href="https://wg21.link/multimap.cons#3">multimap.cons</A>] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

<I>Requires:</I> If the iterator's <DEL>dereference</DEL>
<INS>indirection</INS> operator returns an lvalue or a const rvalue
<TT>pair&lt;key_type, mapped_type&gt;</TT>, then both <TT>key_type</TT> and
<TT>mapped_type</TT> shall be <TT>CopyConstructible</TT>.

</BLOCKQUOTE>

<LI><P>Change 23.4.6.2 [<A href="https://wg21.link/set.cons#4">set.cons</A>] paragraph 4 as follows:</P></LI>

<BLOCKQUOTE>

<I>Requires:</I> If the iterator's <DEL>dereference</DEL>
<INS>indirection</INS> operator returns an lvalue or a non-const
rvalue, then <TT>Key</TT> shall be <TT>CopyConstructible</TT>.

</BLOCKQUOTE>

<LI><P>Change 23.4.7.2 [<A href="https://wg21.link/multiset.cons#3">multiset.cons</A>] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

<I>Requires:</I> If the iterator's <DEL>dereference</DEL>
<INS>indirection</INS> operator returns an lvalue or a const rvalue,
then <TT>Key</TT> shall be <TT>CopyConstructible</TT>.

</BLOCKQUOTE>

<LI><P>Change 24.5.4 [<A href="https://wg21.link/move.iterators#1">move.iterators</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

Class template <TT>move_iterator</TT> is an iterator adaptor with the
same behavior as the underlying iterator except that its
<DEL>dereference</DEL> <INS>indirection</INS> operator implicitly
converts the value returned by the underlying iterator's
<DEL>dereference</DEL> <INS>indirection</INS> operator to an rvalue
reference...

</BLOCKQUOTE>

<LI><P>Change the title of 28.6.11.1.4 [<A href="https://wg21.link/re.regiter.deref">re.regiter.deref</A>] as follows:</P></LI>

<BLOCKQUOTE>

<B><TT>regex_iterator</TT> <DEL>dereference</DEL> <INS>indirection</INS></B>

</BLOCKQUOTE>

<LI><P>Change the title of 28.6.11.2.4 [<A href="https://wg21.link/re.tokiter.deref">re.tokiter.deref</A>] as follows:</P></LI>

<BLOCKQUOTE>

<B><TT>regex_token_iterator</TT> <DEL>dereference</DEL>
<INS>indirection</INS></B>

</BLOCKQUOTE>

</OL>

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