I read interesting things about the copy-and-swap idiom. My question is concerning the implementation of the swap
method when inheriting from another class.
class Foo : public Bar
{
int _m1;
string _m2;
.../...
public:
void swap(Foo &a, Foo &b)
{
using std::swap;
swap(a._m1, b._m1);
swap(a._m2, b._m2);
// what about the Bar private members ???
}
.../...
};