211
I love Rust
(lemmy.blahaj.zone)
Post funny things about programming here! (Or just rant about your favourite programming language.)
Is there a way to avoid having to write the rule of 5 every time you need a destructor?
You mean copy/move constructor and assignment operator?
Unless you have any special handling the ones generated by the compiler automatically should work just fine. But if you do have to define them for some reason (which is becoming increasingly rare) you would need to define both if you need both copy/move construction and copy/move assignment.