Just for completeness, the Standard mandates the behavior from your compiler warning:
12.8 Copying and moving class objects [class.copy]
7 If the class definition does not explicitly declare a copy constructor, one is declared implicitly. If the class definition declares a move constructor or move assignment operator, the implicitly declared copy constructor is defined as deleted; otherwise, it is defined as defaulted (8.4). The latter case is deprecated if the class has a user-declared copy assignment operator or a user-declared destructor.
So if you want copying behavior, you will have to provide a copy constructor and copy assignment operator yourself.
However, looking at your move constructor, it appears that this doesn't provide any move semantics but rather deep copying (hint: what does strcopy()
do? it sure doesn't move). So I would rename your current move constructor to the copy constructor, and provide a new move constructor that actually moves (i.e. re-assigns the char
pointer or whatever is the handle to the actual data in your class).