You are viewing a single comment's thread. Return to all comments →
class Message { string message; int order; static int tot_n; public: Message(){ tot_n++; order = tot_n; } Message(const string& s){ tot_n++; order = tot_n; message = s; } const string& get_text() { return message; } bool operator<(const Message& m){ return (order < m.order); } }; int Message::tot_n = 0; class MessageFactory { public: MessageFactory() {} Message create_message(const string& text) { Message m(text); return m; } };
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 →