For class:
class Foo
{
public:
Foo();
Foo(Foo const&)=delete;
Foo& operator =(Foo const&)=delete;
}
What "=delete" means?
Hi Kathy
It's new feature of C++0x called deleted functions. For example
in C++03 if you want to prohibit the copy operations, i.e nobody
can't to copy an object or assign to, you have to declare
these special member functions private:
class Foo {
private:
Foo(const Foo&);
Foo& operator=(const Foo&);
};
Now you can say more explicit using delete keyword.
Closely related to deleted functions are defaulted functions.
class Foo {
Foo() = default;
};
It means, you accepted the default behavior of default
constructor which compiler generates for you.
Such thing is somehow more elaboration.
HTH,
-- Saeed Amrollahi