une petite question :
dans le code de boost::shared_ptr l'operateur d'affectation est defini ainsi :
Pourquoi pas de swap ici ?Code:
1
2
3
4
5
6 shared_ptr & operator=(shared_ptr const & r) // never throws { px = r.px; pn = r.pn; // shared_count::op= doesn't throw return *this; }