#include "card.h" #include Card::Card(int value, std::string const& suit) : value {value}, suit {suit} { if (value < 1 or value > 13) { throw std::logic_error("Kort utanför interval"); } } int Card::get_value() const { return value; } std::string Card::to_string() const { // övning return "ett kort!"; } bool Card::operator>(Card const& rhs) const { return rhs < *this; } bool Card::operator<(Card const& rhs) const { return value < rhs.value; } std::ostream& operator<<(std::ostream& os, Card const& rhs) { os << rhs.to_string(); return os; } Card& Card::operator++() { // gör addition } Card Card::operator++(int) { Card tmp {*this}; ++(*this); return tmp; }