Use sls::make_unique<>

This commit is contained in:
Samuel Debionne
2019-02-13 08:59:26 +01:00
parent b18391330e
commit f125b94a7d
2 changed files with 7 additions and 9 deletions

View File

@ -11,6 +11,7 @@
#include <map>
#include <getopt.h>
#include "container_utils.h" // For sls::make_unique<>
#include "slsReceiver.h"
#include "slsReceiverTCPIPInterface.h"
@ -78,17 +79,14 @@ slsReceiver::slsReceiver(int argc, char *argv[]):
}
// might throw an exception
//tcpipInterface = std::make_unique<slsReceiverTCPIPInterface>(tcpip_port_no);
tcpipInterface = std::unique_ptr<slsReceiverTCPIPInterface>(new slsReceiverTCPIPInterface(tcpip_port_no));
tcpipInterface = sls::make_unique<slsReceiverTCPIPInterface>(tcpip_port_no);
}
slsReceiver::slsReceiver(int tcpip_port_no)
{
// might throw an exception
//tcpipInterface = std::make_unique<slsReceiverTCPIPInterface>(tcpip_port_no);
tcpipInterface = std::unique_ptr<slsReceiverTCPIPInterface>(new slsReceiverTCPIPInterface(tcpip_port_no));
tcpipInterface = sls::make_unique<slsReceiverTCPIPInterface>(tcpip_port_no);
}