From: Gregor Jasny Date: Wed, 11 Mar 2026 19:17:01 +0000 (+0100) Subject: chore: Use typedefs to access ::type (#1695) X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=98ea8f3e545d33ef43dfcba1641d1f8588407e38;p=thirdparty%2Fccache.git chore: Use typedefs to access ::type (#1695) --- diff --git a/src/ccache/util/bitset.hpp b/src/ccache/util/bitset.hpp index ed0d2a25..1c25aa44 100644 --- a/src/ccache/util/bitset.hpp +++ b/src/ccache/util/bitset.hpp @@ -39,17 +39,17 @@ public: void erase(T value); template static BitSet from_bitmask(U mask); - typename std::underlying_type::type to_bitmask() const; + typename std::underlying_type_t to_bitmask() const; private: - typename std::underlying_type::type m_value; + typename std::underlying_type_t m_value; }; // --- Inline implementations --- template inline BitSet::BitSet(T value) - : m_value(static_cast::type>(value)) + : m_value(static_cast>(value)) { } @@ -71,7 +71,7 @@ template inline bool BitSet::contains(T value) const { - return m_value & static_cast::type>(value); + return m_value & static_cast>(value); } template @@ -85,21 +85,21 @@ template inline void BitSet::insert(T value) { - m_value |= static_cast::type>(value); + m_value |= static_cast>(value); } template inline void BitSet::insert(const BitSet& set) { - m_value |= static_cast::type>(set.m_value); + m_value |= static_cast>(set.m_value); } template inline void BitSet::erase(T value) { - m_value &= ~static_cast::type>(value); + m_value &= ~static_cast>(value); } template @@ -113,7 +113,7 @@ BitSet::from_bitmask(U mask) } template -inline typename std::underlying_type::type +inline typename std::underlying_type_t BitSet::to_bitmask() const { return m_value; diff --git a/src/ccache/util/threadpool.hpp b/src/ccache/util/threadpool.hpp index aacf1453..04689b1d 100644 --- a/src/ccache/util/threadpool.hpp +++ b/src/ccache/util/threadpool.hpp @@ -49,7 +49,7 @@ public: // used to retrieve the result once the task completes. template auto enqueue(F&& f, Args&&... args) - -> std::future::type>; + -> std::future>; void shut_down() noexcept; @@ -68,9 +68,9 @@ private: template auto ThreadPool::enqueue(F&& f, Args&&... args) - -> std::future::type> + -> std::future> { - using return_type = typename std::invoke_result::type; + using return_type = typename std::invoke_result_t; auto task = std::make_shared>( std::bind(std::forward(f), std::forward(args)...));