Question: Here is declaration for the Cpmv class: class Cpmv { public: struct Info { std::string qcode; std::string zcode; }; private: Info *pi; public: Cpmv(); Cpmv(std::string
Here is declaration for the Cpmv class:
class Cpmv
{
public:
struct Info
{
std::string qcode;
std::string zcode;
};
private:
Info *pi;
public:
Cpmv();
Cpmv(std::string q, std::string z);
Cpmv(const Cpmv & cp);
Cpmv(Cpmv && mv);
~Cpmv();
Cpmv & operator=(const Cpmv & cp);
Cpmv & operator=(Cpmv && mv);
Cpmv operator+(const Cpmv & obj) const;
void Display() const;
};
The operator+() function should create an object whose qcode and zcode members concatenate the corresponding members of the operands. Provide code that implements move semantics for the move constructor and the move assignment operator.Write a program that uses all the methods. For testing purposes, make the various methods verbose so that you can see when they are used.
Step by Step Solution
3.43 Rating (162 Votes )
There are 3 Steps involved in it
The operator function needs to create a new object from the arguments It is important to check that ... View full answer
Get step-by-step solutions from verified subject matter experts
