File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -151,11 +151,21 @@ namespace sio
151151 :message(flag_string),_v(v)
152152 {
153153 }
154+
155+ string_message (string&& v)
156+ :message(flag_string),_v(move(v))
157+ {
158+ }
154159 public:
155160 static message::ptr create (string const & v)
156161 {
157162 return ptr (new string_message (v));
158163 }
164+
165+ static message::ptr create (string&& v)
166+ {
167+ return ptr (new string_message (move (v)));
168+ }
159169
160170 string const & get_string () const
161171 {
@@ -258,15 +268,20 @@ namespace sio
258268 m_vector.push_back (message);
259269 }
260270
261- list (string& text)
271+ list (const string& text)
262272 {
263273 m_vector.push_back (string_message::create (text));
264274 }
265275
266- list (const char * text)
276+ list (string&& text)
267277 {
268- if (text)
269- m_vector.push_back (string_message::create (text));
278+ m_vector.push_back (string_message::create (move (text)));
279+ }
280+
281+ list (shared_ptr<string> const & binary)
282+ {
283+ if (binary)
284+ m_vector.push_back (binary_message::create (binary));
270285 }
271286
272287 list (shared_ptr<const string> const & binary)
You can’t perform that action at this time.
0 commit comments