Replace deprecated use of auto_ptr when unique_ptr is available
This commit is contained in:
@@ -46,6 +46,8 @@ HEAD
|
||||
Thank you giachi and Bastien Brunnenstein for reporting. #491
|
||||
- Compatibility: Fixes a number of build & config issues on Visual Studio 2015
|
||||
- Compatibility: Removes non-standards compliant masking behavior. #395, #469
|
||||
- Compatibility: Replace deprecated use of auto_ptr on systems where unique_ptr
|
||||
is available.
|
||||
|
||||
0.6.0
|
||||
- MINOR BREAKING TRANSPORT POLICY CHANGE: Custom transport policies will now be
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace lib {
|
||||
using std::enable_shared_from_this;
|
||||
using std::static_pointer_cast;
|
||||
using std::make_shared;
|
||||
using std::unique_ptr;
|
||||
|
||||
typedef std::unique_ptr<unsigned char[]> unique_ptr_uchar_array;
|
||||
#else
|
||||
|
||||
@@ -218,8 +218,15 @@ public:
|
||||
* @param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
void init_asio(lib::error_code & ec) {
|
||||
// Use a smart pointer until the call is successful and ownership has successfully been taken
|
||||
// Use a smart pointer until the call is successful and ownership has
|
||||
// successfully been taken. Use unique_ptr when available.
|
||||
// TODO: remove the use of auto_ptr when C++98/03 support is no longer
|
||||
// necessary.
|
||||
#ifdef _WEBSOCKETPP_CPP11_MEMORY_
|
||||
lib::unique_ptr<lib::asio::io_service> service(new lib::asio::io_service());
|
||||
#else
|
||||
lib::auto_ptr<lib::asio::io_service> service(new lib::asio::io_service());
|
||||
#endif
|
||||
init_asio(service.get(), ec);
|
||||
if( !ec ) service.release(); // Call was successful, transfer ownership
|
||||
m_external_io_service = false;
|
||||
|
||||
Reference in New Issue
Block a user