From f99b38476062c1df90c1fe3e828e29cfc193a5f3 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 4 Jun 2026 22:11:38 +0200 Subject: upgrade to `using` instead of typedef --- include/winapi/buffer.hpp | 2 +- include/winapi/shmem.hpp | 2 +- include/winapi/sid.hpp | 2 +- test/unit_tests/shared/command.hpp | 14 +++++++------- test/unit_tests/shared/console.hpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/winapi/buffer.hpp b/include/winapi/buffer.hpp index 10ff479..a9243cb 100644 --- a/include/winapi/buffer.hpp +++ b/include/winapi/buffer.hpp @@ -23,7 +23,7 @@ namespace winapi { */ class Buffer : public std::vector { public: - typedef std::vector Parent; + using Parent = std::vector; Buffer() = default; diff --git a/include/winapi/shmem.hpp b/include/winapi/shmem.hpp index d1ad997..4040241 100644 --- a/include/winapi/shmem.hpp +++ b/include/winapi/shmem.hpp @@ -52,7 +52,7 @@ private: template class SharedObject { public: - typedef typename std::aligned_storage::type AlignedType; + using AlignedType = std::aligned_storage::type; /** * Create the object & construct a shared memory region to store it. diff --git a/include/winapi/sid.hpp b/include/winapi/sid.hpp index 5a7c759..ab8c62c 100644 --- a/include/winapi/sid.hpp +++ b/include/winapi/sid.hpp @@ -18,7 +18,7 @@ class Sid { public: static constexpr std::size_t MAX_SID_SIZE = SECURITY_MAX_SID_SIZE; - typedef SID Impl; + using Impl = SID; static Sid well_known(WELL_KNOWN_SID_TYPE type); diff --git a/test/unit_tests/shared/command.hpp b/test/unit_tests/shared/command.hpp index 4ba9385..a24370a 100644 --- a/test/unit_tests/shared/command.hpp +++ b/test/unit_tests/shared/command.hpp @@ -52,15 +52,15 @@ public: fixed_size::StringList<> console_buffer; }; - typedef winapi::SharedObject Shared; + using Shared = winapi::SharedObject; - typedef boost::interprocess::interprocess_mutex mutex; - typedef boost::interprocess::interprocess_condition condition_variable; - typedef boost::interprocess::scoped_lock lock; + using mutex = boost::interprocess::interprocess_mutex; + using condition_variable = boost::interprocess::interprocess_condition; + using lock = boost::interprocess::scoped_lock; - typedef std::function SetArgs; - typedef std::function ReadResult; - typedef std::function ProcessAction; + using SetArgs = std::function; + using ReadResult = std::function; + using ProcessAction = std::function; static Shared create() { return Shared::create(COMMAND_SHMEM_NAME); } static Shared open() { return Shared::open(COMMAND_SHMEM_NAME); } diff --git a/test/unit_tests/shared/console.hpp b/test/unit_tests/shared/console.hpp index 2dcb78b..55907c2 100644 --- a/test/unit_tests/shared/console.hpp +++ b/test/unit_tests/shared/console.hpp @@ -26,7 +26,7 @@ namespace console { class Buffer { public: - typedef CONSOLE_SCREEN_BUFFER_INFO Info; + using Info = CONSOLE_SCREEN_BUFFER_INFO; Buffer() : m_handle{winapi::Handle::std_out()}, m_info{get_info(m_handle)} {} -- cgit v1.3