Based on the popular answer What is the copy-and-swap idiom? :
(1) Why does the rule of 4.5 not include the move assignment operator(to effectively become the rule of 5.5)? Instead I've read(eg. here What is the Rule of Four (and a half)?) that we either have rule of 4.5 or 5?
(2) Since the swap member function is noexcept, shouldnt the copy assignment operator also be marked the same(the move constructor can't since it calls the default constructor that can throw)?
samedi 5 janvier 2019
Rule of 4.5: No move assignment operator?
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire