You are viewing a single comment's thread. Return to all comments →
class Message { private: string s; int order; public: Message(const string& text, int Order) { s = text; order = Order; } const string& get_text() { return s; } bool operator < (const Message& second) { return order < second.order; } }; class MessageFactory { public: static int counter; MessageFactory() {} Message create_message(const string& text) { Message temp(text, counter); counter++; return temp; } }; int MessageFactory::counter = 1;
Seems like cookies are disabled on this browser, please enable them to open this website
Messages Order
You are viewing a single comment's thread. Return to all comments →