From 38140372d8c8dd32267943d5d79b2ce2c0a032fb Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Tue, 31 Oct 2017 15:01:57 +0100 Subject: Use std::make_unique --- src/x.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/x.cc') diff --git a/src/x.cc b/src/x.cc index 3749f81..1be092a 100644 --- a/src/x.cc +++ b/src/x.cc @@ -123,7 +123,7 @@ private: if (supported_ || !conn_) return; ensure_cookies(); auto cookie = xcb_ewmh_get_supported(&ewmh_, screen_); - supported_.reset(new xcb_ewmh_get_atoms_reply_t()); + supported_ = std::make_unique(); if (!xcb_ewmh_get_supported_reply(&ewmh_, cookie, supported_.get(), nullptr)) { conn_.reset(); @@ -140,13 +140,13 @@ private: } // namespace // static -Atoms* Atoms::create(shared_connection const& conn) { - return new AtomsImpl(conn); +std::unique_ptr Atoms::create(shared_connection const& conn) { + return std::make_unique(conn); } // static -Ewmh* Ewmh::create(shared_connection const& conn, int screen) { - return new EwmhImpl(conn, screen); +std::unique_ptr Ewmh::create(shared_connection const& conn, int screen) { + return std::make_unique(conn, screen); } xcb_screen_t const* get_screen(xcb_connection_t* conn, int screen) { -- cgit v1.3