Changeset a4b3525
- Timestamp:
- Jun 30, 2017, 5:45:49 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 05385a6
- Parents:
- 435e75f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/proposals/references.md
r435e75f ra4b3525 17 17 derived rvalue types such as pointer types may include qualifiers; 18 18 `const int *` is a distinct type from `int *`, though the latter is safely 19 convert able to the former.19 convertible to the former. 20 20 In general, any number of qualifiers can be safely added to the 21 21 pointed-to-type of a pointer type, e.g. `int *` converts safely to … … 23 23 `const volatile int *`. 24 24 25 Since lvalues are preci cely "addressable objects", in C, only lvalues can be25 Since lvalues are precisely "addressable objects", in C, only lvalues can be 26 26 used as the operand of the `&` address-of operator. 27 27 Similarly, only modifiable lvalues may be used as the assigned-to … … 147 147 call "lvalue of type `T`" as `T&`. 148 148 There's also an obvious argument that lvalues of a (possibly-qualified) type 149 `T` should be convert able to references of type `T`, where `T` is also149 `T` should be convertible to references of type `T`, where `T` is also 150 150 so-qualified (e.g. lvalue `int` to `int&`, lvalue `const char` to 151 151 `const char&`). 152 152 By similar arguments to pointer types, qualifiers should be addable to the 153 153 referred-to type of a reference (e.g. `int&` to `const int&`). 154 As a note, since pointer arithmetic is explic tly not defined on `T&`,154 As a note, since pointer arithmetic is explicitly not defined on `T&`, 155 155 `restrict T&` should be allowable and would have alias-analysis rules that 156 156 are actually comprehensible to mere mortals.
Note: See TracChangeset
for help on using the changeset viewer.