diff options
| author | Joel Klinghed <the_jk@opera.com> | 2017-10-31 15:01:57 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@opera.com> | 2017-10-31 15:01:57 +0100 |
| commit | 38140372d8c8dd32267943d5d79b2ce2c0a032fb (patch) | |
| tree | 0e2555e591092f934e05451ef4a6df18c5ddc739 /src/x.cc | |
| parent | 2e5352a1128da3ff4637561788a7da8e6b24ab9c (diff) | |
Use std::make_unique
Diffstat (limited to 'src/x.cc')
| -rw-r--r-- | src/x.cc | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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<xcb_ewmh_get_atoms_reply_t>(); 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> Atoms::create(shared_connection const& conn) { + return std::make_unique<AtomsImpl>(conn); } // static -Ewmh* Ewmh::create(shared_connection const& conn, int screen) { - return new EwmhImpl(conn, screen); +std::unique_ptr<Ewmh> Ewmh::create(shared_connection const& conn, int screen) { + return std::make_unique<EwmhImpl>(conn, screen); } xcb_screen_t const* get_screen(xcb_connection_t* conn, int screen) { |
