Files
concurrency-in-action/source/listing_a.1.cpp
2014-04-22 21:54:16 -04:00

24 lines
341 B
C++

class X
{
private:
int* data;
public:
X():
data(new int[1000000])
{}
~X()
{
delete [] data;
}
X(const X& other):
data(new int[1000000])
{
std::copy(other.data,other.data+1000000,data);
}
X(X&& other):
data(other.data)
{
other.data=nullptr;
}
};