Tuesday, 20 August 2013

What does prohibiting value semantics in C++ mean?

What does prohibiting value semantics in C++ mean?

I have the following peace of the code:
template<typename T>
class derClass : public baseClass<column<T>, column<k>>
{
//prohibit value semantics
derClass(const derClass&) = delete;
derClass& operator= (const derClass&) = delete;
public:
...
}
There are many places of this code that I do not understand:
What does these delete mean? I do not see any declaration of the delete
variable.
Why do we need a constructor that takes as argument an object of the same
class?
What does this whole line mean: derClass& operator= (const derClass&) =
delete;

No comments:

Post a Comment