File tree 1 file changed +8
-1
lines changed
websocketpp/transport/asio
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -240,8 +240,15 @@ class endpoint : public config::socket_type {
240
240
* @see init_asio(io_service_ptr ptr)
241
241
*/
242
242
void init_asio () {
243
- // Use a smart pointer until the call is successful and ownership transferred
243
+ // Use a smart pointer until the call is successful and ownership has
244
+ // successfully been taken. Use unique_ptr when available.
245
+ // TODO: remove the use of auto_ptr when C++98/03 support is no longer
246
+ // necessary.
247
+ #ifdef _WEBSOCKETPP_CPP11_MEMORY_
248
+ lib::unique_ptr<lib::asio::io_service> service (new lib::asio::io_service ());
249
+ #else
244
250
lib::auto_ptr<lib::asio::io_service> service (new lib::asio::io_service ());
251
+ #endif
245
252
init_asio ( service.get () );
246
253
// If control got this far without an exception, then ownership has successfully been taken
247
254
service.release ();
You can’t perform that action at this time.
0 commit comments