1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-29 00:22:21 +01:00

Use standard version of make_unique when available (#2292)

This commit is contained in:
Oxan van Leeuwen
2021-09-14 14:27:35 +02:00
committed by GitHub
parent 4cc2817fcd
commit 716039e452
8 changed files with 35 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
#include "socket.h"
#include "esphome/core/defines.h"
#include "esphome/core/helpers.h"
#ifdef USE_SOCKET_IMPL_BSD_SOCKETS
@@ -39,7 +40,7 @@ class BSDSocketImpl : public Socket {
int fd = ::accept(fd_, addr, addrlen);
if (fd == -1)
return {};
return std::unique_ptr<BSDSocketImpl>{new BSDSocketImpl(fd)};
return make_unique<BSDSocketImpl>(fd);
}
int bind(const struct sockaddr *addr, socklen_t addrlen) override { return ::bind(fd_, addr, addrlen); }
int close() override {