#include #include using namespace std; struct Card { string suit; string value; }; /* Lägg till din Card_ptr klass här */ class Card_ptr { public: Card_ptr(string const& suit, string const& value) : card{new Card{suit, value}} {} Card_ptr(Card_ptr const& other) = delete; Card_ptr& operator=(Card_ptr const& other) = delete; Card_ptr(Card_ptr && other) : card{other.card} { other.card = nullptr; } Card_ptr& operator=(Card_ptr && other) { swap(card, other.card); return *this; } Card& operator*() { return *card; } ~Card_ptr() { delete card; } private: Card* card; }; int main () { Card_ptr H10{"Heart", "10"}; Card_ptr SJ{"Spade", "J"}; cout << (*H10).value << " of " << (*H10).suit << "s\n" << (*SJ).value << " of " << (*SJ).suit << "s" << endl; }