[Kde-pim] use of std::swap in gpgme++
Aaron J. Seigo
aseigo at kde.org
Thu May 26 13:56:58 BST 2011
hi...
looking at gpgme++ today i noticed code like this:
const VerificationResult & operator=( VerificationResult other ) {
· swap( other );
· return *this;
}
void swap( VerificationResult & other ) {
· Result::swap( other );
· using std::swap;
· swap( this->d, other.d );
}
is swapping d pointers on assignment intentional? it seems a bit odd that
assigning an object to another results in them swapping their data. (as
opposed to assigning the rhs to the lhs)
--
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110526/963949be/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list