Skip to content

Commit 0b393c4

Browse files
committed
[any_view] reword moved from state
1 parent d646777 commit 0b393c4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

any_view.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,7 @@ In the original design, we proposed any operations, other than assignment or des
579579
|5 |2 |0 |2 |0 |
580580

581581
This revision (R4) follows SG9's recommendation to make the moved-from state as an empty view. However, the authors still believe that this is a wrong decision.
582-
This is an unprecedented design in the standard library type erasure facilities. We did not make `std::any` to assign an empty `struct` to a moved-from object.
583-
We did not make `std::{copyable_,move_only}function<void()>` to assign `[]{}` to a moved-from object. This is adding unnecessary complexity. Instead, we should
584-
just discourage people from using the moved-from object other than destruction or assignment.
582+
This is an unprecedented design in the standard library type erasure facilities. All existing type erasure utilities in the library leave the moved-from object in a valid but unspecified state. Assigning `any_view`'s moved-from state to be an empty view adds unnecessary complexity and goes against "don't pay for what you don't use" philosophy.
585583

586584
## ABI Stability
587585

0 commit comments

Comments
 (0)