r/cpp • • Oct 24 '24 • Take My Silver 1

Why Safety Profiles Failed

https://www.circle-lang.org/draft-profiles.html
180 Upvotes

347 comments sorted by

View all comments

Show parent comment

2

u/sephirothbahamut Oct 25 '24

Honestly I'd like a nguage to have both, destructive and "emptying" move. All classes that can move can have a destructive move. Some classes like containers can also have an emptying one that leves the object in a valid state. The user could be able to specify when they want one or the other to occur. Alternatively the compiler may infer it: if the variable isn't used after, do a destructive move, if it is do an emptying move if available, otherwise raise compilation error.