use std::unique_ptr instead of std::auto_ptr with C++11+ compilers to prevent std::auto_ptr deprecation warnings

This commit is contained in:
root
2016-10-14 11:49:45 +02:00
parent 12fc175b5a
commit 895c3dfcd5
5 changed files with 20 additions and 0 deletions

View File

@@ -78,7 +78,11 @@ void HTTPServerConnection::run()
response.set("Server", server);
try
{
#if __cplusplus < 201103L
std::auto_ptr<HTTPRequestHandler> pHandler(_pFactory->createRequestHandler(request));
#else
std::unique_ptr<HTTPRequestHandler> pHandler(_pFactory->createRequestHandler(request));
#endif
if (pHandler.get())
{
if (request.expectContinue())

View File

@@ -110,7 +110,11 @@ void TCPServerDispatcher::run()
TCPConnectionNotification* pCNf = dynamic_cast<TCPConnectionNotification*>(pNf.get());
if (pCNf)
{
#if __cplusplus < 201103L
std::auto_ptr<TCPServerConnection> pConnection(_pConnectionFactory->createConnection(pCNf->socket()));
#else
std::unique_ptr<TCPServerConnection> pConnection(_pConnectionFactory->createConnection(pCNf->socket()));
#endif
poco_check_ptr(pConnection.get());
beginConnection();
pConnection->start();