- Title
- Terminology: "indirection" versus "dereference"
- Status
- cd3
- Section
- 7.6.2 [expr.unary]
- Submitter
- Jason Merrill
Created on 2001-10-07.00:00:00 last changed 151 months ago
Messages
Date: 2012-10-15.00:00:00
[Moved to DR at the October, 2012 meeting.]
Date: 2012-02-15.00:00:00
Proposed resolution (February, 2012): Change 6.8.6.5.2 [basic.stc.dynamic.allocation] paragraph 2 as follows: Change _N4885_6.7.5.5.4 [basic.stc.dynamic.safety] paragraph 2 as follows: the value returned by a call to the C ++ standard library
implementation of ::operator new(std:: size_t) ;
[Footnote: This section does not impose restrictions on
the result of taking the address of an object (or one of its
subobjects) designated by an lvalue resulting from
... Change 6.8.4 [basic.life] paragraph 5 as follows: Change 7.3.13 [conv.mem] paragraph 2 as follows: Change 7.6.1.9 [expr.static.cast] paragraph 12 as follows: Change 7.6.2.2 [expr.unary.op] paragraph 1 as follows: Change 7.6.10 [expr.eq] paragraph 2 as follows: Change 9.12 [dcl.link] paragraph 8: Change 9.3.4.3 [dcl.ref] paragraph 5 as follows: Change 16.4.4.6 [allocator.requirements] table 27: Change 20.2.3.3 [pointer.traits.functions] as follows: Change _N4885_.20.10.5 [util.dynamic.safety] paragraph 10 as follows: Change 26.11 [specialized.algorithms] paragraph 1 as follows: Change 28.3.4.6.2.3 [locale.time.get.virtuals] paragraph 11 as follows: Change 23.4.3.2 [map.cons] paragraph 3 as follows: Change 23.4.4.2 [multimap.cons] paragraph 3 as follows: Change 23.4.6.2 [set.cons] paragraph 4 as follows: Change 23.4.7.2 [multiset.cons] paragraph 3 as follows: Change 24.5.4 [move.iterators] paragraph 1 as follows: Change the title of 28.6.11.1.4 [re.regiter.deref] as follows: Change the title of 28.6.11.2.4 [re.tokiter.deref] as follows:
...The effect of
dereferencing indirecting
through a pointer returned as a request for zero size is
undefined.
dereferencing indirection through pointers to
memory not allocated by ::operator new . 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 dereferencing indirection
through pointers to memory allocated by
std::malloc is not restricted. —end
footnote]dereferencing indirection through a
safely-derived pointer value;
...
Such Indirection through such a pointer
may be dereferenced is permitted but the
resulting lvalue may only be used in limited ways...
...Since the result has type “pointer to member of D of
type cv T ”,
it can be dereferenced
indirection through it with a D object is
valid. The result is the same as if indirecting
through the pointer to member of B were
dereferenced with the B subobject of D . The
null member pointer value...
...[Note: although class B need not contain the
original member, the dynamic type of the object
on
with which indirection through the pointer to
member is dereferenced performed must contain
the original member; see 7.6.4 [expr.mptr.oper]. —end
note]
...[Note: indirection through a pointer to an
incomplete type (other than cv void )
can be
dereferenced is valid. The lvalue thus obtained...
...Otherwise they compare equal if and only if they would refer to the
same member of the same most derived object (6.8.2 [intro.object])
or the same subobject if
they were dereferenced
indirection with a hypothetical object of the associated
class type were performed. [Example:...
[Note: Because the language linkage is part of a function type,
when indirecting through a pointer to C function
(for
example) is dereferenced, the function to which it
the resulting lvalue refers is considered a C
function. —end note]
...[Note: 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 “object” obtained by
dereferencing indirection through a null
pointer, which causes undefined behavior. As described...
Variable
Definition
...
c
a
dereferenceable pointer of type C* through which indirection is valid
...
Returns: The first member function returns a
dereferenceable pointer to r obtained by calling
Ptr::pointer_to(r) through which indirection is
valid; an instantiation of this function is ill-formed...
Effects: The n bytes starting at p no longer
contain traceable pointer locations, independent of their type. Hence
pointers indirection through a pointer located
there may not be dereferenced is undefined if
the object they point it points to was created
by global operator new and not previously declared
reachable...
...is required to have the property that no exceptions are thrown from
increment, assignment, comparison, or
dereference of
indirection through valid iterators...
Requires: t shall
be dereferenceable
point to an object.
Requires: If the iterator's
dereference
indirection operator returns an lvalue or a const rvalue
pair<key_type, mapped_type> , then both
key_type and mapped_type shall be
CopyConstructible .
Requires: If the iterator's
dereference
indirection operator returns an lvalue or a const rvalue
pair<key_type, mapped_type> , then both key_type and
mapped_type shall be CopyConstructible .
Requires: If the iterator's
dereference
indirection operator returns an lvalue or a non-const
rvalue, then Key shall be CopyConstructible .
Requires: If the iterator's
dereference
indirection operator returns an lvalue or a const rvalue,
then Key shall be CopyConstructible .
Class template move_iterator is an iterator adaptor with the
same behavior as the underlying iterator except that its
dereference indirection operator implicitly
converts the value returned by the underlying iterator's
dereference indirection operator to an rvalue
reference...
regex_iterator
dereference indirection
regex_token_iterator
dereference
indirection
Date: 2011-08-15.00:00:00
Notes from the August, 2011 meeting: CWG prefers use of the term “indirection” instead of
“dereferencing.” This would be consistent with the usage
in the C Standard and would avoid entanglement with the C++ concept
of a reference type.
Date: 2006-12-15.00:00:00
Proposed resolution (December, 2006): Change 7.6.2.2 [expr.unary.op] paragraph 1 as follows: Change 9.3.4.5 [dcl.array] paragraph 8 as follows: Change 9.3.4.6 [dcl.fct] paragraph 9 as follows: Change the index for * and “dereferencing”
no longer to refer to “indirection.” [Drafting note: 29.6.9 [template.indirect.array]
requires no change. Many more places in the current wording use
“dereferencing” than “indirection.”]
The unary *
operator
performs indirection dereferences a pointer
value: the expression to which it is applied shall be a pointer...
The
results are added and indirection applied values are
added and the result is dereferenced to yield an array (of five
integers), which in turn is converted to a pointer to the first of the
integers.
The binding of *fpi(int) is *(fpi(int)) , so the
declaration suggests, and the same construction in an expression
requires, the calling of a function fpi , and then
using
indirection through dereferencing the (pointer) result
to yield an integer. In the declarator (*pif)(const char*, const
char*) , the extra parentheses are necessary to indicate that
indirection through dereferencing a pointer to a
function yields a function, which is then called.
Date: 2004-09-10.00:00:00
Split off from issue 315. Incidentally, another thing that ought to be cleaned up is the inconsistent
use of "indirection" and "dereference". We should pick one.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2014-03-03 00:00:00 | admin | set | status: drwp -> cd3 |
| 2013-05-03 00:00:00 | admin | set | status: dr -> drwp |
| 2012-11-03 00:00:00 | admin | set | messages: + msg4132 |
| 2012-11-03 00:00:00 | admin | set | status: ready -> dr |
| 2012-02-27 00:00:00 | admin | set | messages: + msg3701 |
| 2012-02-27 00:00:00 | admin | set | status: drafting -> ready |
| 2011-09-06 00:00:00 | admin | set | messages: + msg3521 |
| 2011-09-06 00:00:00 | admin | set | status: review -> drafting |
| 2006-11-05 00:00:00 | admin | set | messages: + msg1403 |
| 2006-11-05 00:00:00 | admin | set | status: open -> review |
| 2001-10-07 00:00:00 | admin | create | |