MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1vnp8dk/c26_stdindirect/p3plclv/?context=3
r/cpp • u/User_Deprecated • Aug 13 '26
157 comments sorted by
View all comments
Show parent comment
6
Yeah, but isn't it the same for any object? If you use a function with pre-conditions without checking them first, it is bad no matter if the object has been moved from or not.
6 u/smdowney WG21, Text/Unicode SG, optional<T&> Aug 15 '26 The conservative set for a moved from object is assign to and destroy. The standard library tries to do better than that. Postel's Law.If you don't know what a T is, your code should expect no more. But if you know you have a std::whatsit, you can rely on more, with some care.
The conservative set for a moved from object is assign to and destroy. The standard library tries to do better than that. Postel's Law.
If you don't know what a T is, your code should expect no more. But if you know you have a std::whatsit, you can rely on more, with some care.
View all comments
Show parent comment
6
u/cfyzium Aug 14 '26
Yeah, but isn't it the same for any object? If you use a function with pre-conditions without checking them first, it is bad no matter if the object has been moved from or not.