From Jason Turner

[conv.mem]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp2uvjib4m/{from.md → to.md} +13 -11
tmp/tmp2uvjib4m/{from.md → to.md} RENAMED
@@ -2,27 +2,29 @@
2
 
3
  A null pointer constant [[conv.ptr]] can be converted to a
4
  pointer-to-member type; the result is the *null member pointer value* of
5
  that type and is distinguishable from any pointer to member not created
6
  from a null pointer constant. Such a conversion is called a *null member
7
- pointer conversion*. Two null member pointer values of the same type
8
- shall compare equal. The conversion of a null pointer constant to a
9
  pointer to member of cv-qualified type is a single conversion, and not
10
  the sequence of a pointer-to-member conversion followed by a
11
  qualification conversion [[conv.qual]].
12
 
13
  A prvalue of type “pointer to member of `B` of type cv `T`”, where `B`
14
  is a class type, can be converted to a prvalue of type “pointer to
15
  member of `D` of type cv `T`”, where `D` is a complete class derived
16
  [[class.derived]] from `B`. If `B` is an inaccessible [[class.access]],
17
  ambiguous [[class.member.lookup]], or virtual [[class.mi]] base class of
18
  `D`, or a base class of a virtual base class of `D`, a program that
19
- necessitates this conversion is ill-formed. The result of the conversion
20
- refers to the same member as the pointer to member before the conversion
21
- took place, but it refers to the base class member as if it were a
22
- member of the derived class. The result refers to the member in `D`’s
23
- instance of `B`. Since the result has type “pointer to member of `D` of
24
- type cv `T`”, indirection through it with a `D` object is valid. The
25
- result is the same as if indirecting through the pointer to member of
26
- `B` with the `B` subobject of `D`. The null member pointer value is
27
- converted to the null member pointer value of the destination type.[^8]
 
 
 
28
 
 
2
 
3
  A null pointer constant [[conv.ptr]] can be converted to a
4
  pointer-to-member type; the result is the *null member pointer value* of
5
  that type and is distinguishable from any pointer to member not created
6
  from a null pointer constant. Such a conversion is called a *null member
7
+ pointer conversion*. The conversion of a null pointer constant to a
 
8
  pointer to member of cv-qualified type is a single conversion, and not
9
  the sequence of a pointer-to-member conversion followed by a
10
  qualification conversion [[conv.qual]].
11
 
12
  A prvalue of type “pointer to member of `B` of type cv `T`”, where `B`
13
  is a class type, can be converted to a prvalue of type “pointer to
14
  member of `D` of type cv `T`”, where `D` is a complete class derived
15
  [[class.derived]] from `B`. If `B` is an inaccessible [[class.access]],
16
  ambiguous [[class.member.lookup]], or virtual [[class.mi]] base class of
17
  `D`, or a base class of a virtual base class of `D`, a program that
18
+ necessitates this conversion is ill-formed. If class `D` does not
19
+ contain the original member and is not a base class of the class
20
+ containing the original member, the behavior is undefined. Otherwise,
21
+ the result of the conversion refers to the same member as the pointer to
22
+ member before the conversion took place, but it refers to the base class
23
+ member as if it were a member of the derived class. The result refers to
24
+ the member in `D`’s instance of `B`. Since the result has type “pointer
25
+ to member of `D` of type cv `T`”, indirection through it with a `D`
26
+ object is valid. The result is the same as if indirecting through the
27
+ pointer to member of `B` with the `B` subobject of `D`. The null member
28
+ pointer value is converted to the null member pointer value of the
29
+ destination type.[^8]
30