From ad78d67f131cc4e8ea158ecf01321cd498e72b56 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 5 May 2022 20:18:50 +0300 Subject: Autocommit at 05.05.2022 @ 20:18 --- src/EventSystem/Ticket.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/EventSystem/Ticket.cpp') diff --git a/src/EventSystem/Ticket.cpp b/src/EventSystem/Ticket.cpp index 0199654..997045e 100644 --- a/src/EventSystem/Ticket.cpp +++ b/src/EventSystem/Ticket.cpp @@ -30,3 +30,16 @@ int Ticket::compare(const Ticket& other) const { return (seat > other.seat) - (other.seat < seat); return (row > other.row) - (other.row < row); } + +/* General */ + +std::istream& operator>>(std::istream& istr, Ticket& ticket) { + unsigned row, seat; + istr >> row >> seat; + ticket = Ticket(row, seat); + return istr; +} + +std::ostream& operator<<(std::ostream& ostr, const Ticket& ticket) { + return ostr << ticket.get_row() << " " << ticket.get_seat(); +} -- cgit v1.3.1-23-gd82d