4
What does that mean delete
in front of the builder?
Grap& operator=(const Grab &g) = delete;
4
What does that mean delete
in front of the builder?
Grap& operator=(const Grab &g) = delete;
2
Note that this is an assignment operator and not a constructor.
It is invalidating this operation. Every type in C++ has the assignment operator automatically created by the compiler if none is provided. When your type cannot allow assignments to be done with it, this is the way to prevent the compiler from creating the operator for you.
You can do the same with the copy operator.
Only available from C++11.
Browser other questions tagged c++ oop operators c++11
You are not signed in. Login or sign up in order to post.