I'm reading book about C++ and came across copy-constructor. So I have a problem understanding this material. In which situation we should write our own functions for copy-control (assignment operator, copy-constructor)?
For example: Should we use here this functions
class TextQuery {
public:
using lineNo = vector<string>::size_type;
explicit TextQuery(ifstream&);
QueryResult query(const string&) const;
private:
shared_ptr<vector<string>> file;
map<string, shared_ptr<set<lineNo>>> wm;
};