Okay, I'm with you on that one.Quote:
Don't implement the swap method in terms of copy constructor (which std::swap already does). Instead, swap around the members contained within Foo. For example, a string would swap the pointers to the internal buffer (as well as the other data members) without constructing a third string.
So, basically I can't extend std::swap if I plan on keeping copying private?Quote:
As a side note, the following compiles with VC++ 2005, but not with MinGW 3.4.5.
And to laserlight,
Imagine a deck of cards if you will. You can hand those cards out, and you can put them back in the deck. However, i don't want to put cards back that came from some other deck or elsewhere.