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
151
151
:message(flag_string),_v(v)
152
152
{
153
153
}
154
+
155
+ string_message (string&& v)
156
+ :message(flag_string),_v(move(v))
157
+ {
158
+ }
154
159
public:
155
160
static message::ptr create (string const & v)
156
161
{
157
162
return ptr (new string_message (v));
158
163
}
164
+
165
+ static message::ptr create (string&& v)
166
+ {
167
+ return ptr (new string_message (move (v)));
168
+ }
159
169
160
170
string const & get_string () const
161
171
{
@@ -258,15 +268,20 @@ namespace sio
258
268
m_vector.push_back (message);
259
269
}
260
270
261
- list (string& text)
271
+ list (const string& text)
262
272
{
263
273
m_vector.push_back (string_message::create (text));
264
274
}
265
275
266
- list (const char * text)
276
+ list (string&& text)
267
277
{
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));
270
285
}
271
286
272
287
list (shared_ptr<const string> const & binary)
You can’t perform that action at this time.
0 commit comments