From Jason Turner

[over.ass]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpk5ms0jfy/{from.md → to.md} +19 -13
tmp/tmpk5ms0jfy/{from.md → to.md} RENAMED
@@ -1,22 +1,28 @@
1
- ### Assignment <a id="over.ass">[[over.ass]]</a>
2
 
3
- An assignment operator shall be implemented by a non-static member
4
- function with exactly one parameter. Because a copy assignment operator
5
- `operator=` is implicitly declared for a class if not declared by the
6
- user ([[class.copy]]), a base class assignment operator is always
7
- hidden by the copy assignment operator of the derived class.
8
 
9
- Any assignment operator, even the copy and move assignment operators,
10
- can be virtual.
 
 
11
 
12
- [*Note 1*:
 
 
 
13
 
14
- For a derived class `D` with a base class `B` for which a virtual
15
- copy/move assignment has been declared, the copy/move assignment
16
- operator in `D` does not override `B`’s virtual copy/move assignment
17
- operator.
 
 
 
18
 
19
  [*Example 1*:
20
 
21
  ``` cpp
22
  struct B {
 
1
+ #### Simple assignment <a id="over.ass">[[over.ass]]</a>
2
 
3
+ A *simple assignment operator function* is a binary operator function
4
+ named `operator=`. A simple assignment operator function shall be a
5
+ non-static member function.
 
 
6
 
7
+ [*Note 1*: Because only standard conversion sequences are considered
8
+ when converting to the left operand of an assignment operation
9
+ [[over.best.ics]], an expression `x = y` with a subexpression x of class
10
+ type is always interpreted as `x.operator=(y)`. — *end note*]
11
 
12
+ [*Note 2*: Since a copy assignment operator is implicitly declared for
13
+ a class if not declared by the user [[class.copy.assign]], a base class
14
+ assignment operator function is always hidden by the copy assignment
15
+ operator function of the derived class. — *end note*]
16
 
17
+ [*Note 3*:
18
+
19
+ Any assignment operator function, even the copy and move assignment
20
+ operators, can be virtual. For a derived class `D` with a base class `B`
21
+ for which a virtual copy/move assignment has been declared, the
22
+ copy/move assignment operator in `D` does not override `B`’s virtual
23
+ copy/move assignment operator.
24
 
25
  [*Example 1*:
26
 
27
  ``` cpp
28
  struct B {