diff --git a/mbo/container/any_scan.h b/mbo/container/any_scan.h index 64a06c9c..868f8678 100644 --- a/mbo/container/any_scan.h +++ b/mbo/container/any_scan.h @@ -304,7 +304,7 @@ class AnyScanImpl { requires(mbo::types::IsPair>) struct FirstType { using RawPair = std::remove_cvref_t; - using RawFirst = typename RawPair::first_type; + using RawFirst = RawPair::first_type; using type = mbo::types::Cases< mbo::types::IfThen && std::is_reference_v, const RawFirst&>, mbo::types::IfThen, const RawFirst>, @@ -317,8 +317,8 @@ class AnyScanImpl { using RawSrc = std::remove_cvref_t; using RawDst = std::remove_cvref_t; if constexpr (::mbo::types::IsPair && ::mbo::types::IsPair) { - using SrcFirstType = typename FirstType::type; - using DstFirstType = typename FirstType::type; + using SrcFirstType = FirstType::type; + using DstFirstType = FirstType::type; static_assert( std::convertible_to, "A common reason for this to fail is scanning over `std::map` and similar indexed containers " diff --git a/mbo/digest/digest.h b/mbo/digest/digest.h index 752967ef..9d99aa4b 100644 --- a/mbo/digest/digest.h +++ b/mbo/digest/digest.h @@ -62,7 +62,7 @@ template requires(IsDigestAlgorithm && HasStreaming) class Streamer { public: - using DigestType = typename Algo::DigestType; + using DigestType = Algo::DigestType; constexpr Streamer() noexcept : state_(Algo::StreamInit()) {} @@ -74,7 +74,7 @@ class Streamer { [[nodiscard]] constexpr DigestType Finalize() const noexcept { return Algo::StreamFinalize(state_); } private: - typename Algo::StreamState state_; + Algo::StreamState state_; }; // Lowercase hex rendering, the conventional presentation of a digest (matches diff --git a/mbo/digest/digest_concepts.h b/mbo/digest/digest_concepts.h index 23255d62..5df1a10c 100644 --- a/mbo/digest/digest_concepts.h +++ b/mbo/digest/digest_concepts.h @@ -40,7 +40,7 @@ concept IsDigestAlgorithm = requires(std::string_view data) { // Streaming (incremental) interface. `StreamFinalize` takes the state by // value, so a stream can be finalized ("peeked") and then continued. template -concept HasStreaming = requires(typename Algo::StreamState state, std::string_view data) { +concept HasStreaming = requires(Algo::StreamState state, std::string_view data) { { Algo::StreamInit() } noexcept -> std::same_as; { Algo::StreamUpdate(state, data) } noexcept; { Algo::StreamFinalize(state) } noexcept -> std::same_as; diff --git a/mbo/digest/digest_hmac.h b/mbo/digest/digest_hmac.h index 2e410df9..c27f08d2 100644 --- a/mbo/digest/digest_hmac.h +++ b/mbo/digest/digest_hmac.h @@ -52,12 +52,12 @@ requires(IsDigestAlgorithm && HasStreaming) struct Hmac { static constexpr std::size_t kDigestSize = Algo::kDigestSize; static constexpr std::size_t kBlockSize = Algo::kBlockSize; - using DigestType = typename Algo::DigestType; + using DigestType = Algo::DigestType; static_assert(kDigestSize <= kBlockSize, "HMAC requires the digest to fit one block."); struct StreamState { - typename Algo::StreamState inner; + Algo::StreamState inner; std::array opad = {}; }; @@ -116,7 +116,7 @@ template requires(IsDigestAlgorithm && HasStreaming) class HmacStreamer { public: - using DigestType = typename Algo::DigestType; + using DigestType = Algo::DigestType; constexpr explicit HmacStreamer(std::string_view key) noexcept : state_(Hmac::StreamInit(key)) {} @@ -128,7 +128,7 @@ class HmacStreamer { [[nodiscard]] constexpr DigestType Finalize() const noexcept { return Hmac::StreamFinalize(state_); } private: - typename Hmac::StreamState state_; + Hmac::StreamState state_; }; // NOLINTEND(*-magic-numbers,*-easily-swappable-parameters,*-constant-array-index) diff --git a/mbo/hash/hash.h b/mbo/hash/hash.h index e31713fc..786ab845 100644 --- a/mbo/hash/hash.h +++ b/mbo/hash/hash.h @@ -137,7 +137,7 @@ struct Hasher { // (e.g. rapidhash in hash_extra.h has no canonical streaming form) -- absence // is honest. template -concept HasStreaming = requires(typename Algo::StreamState state, std::string_view data, uint64_t seed) { +concept HasStreaming = requires(Algo::StreamState state, std::string_view data, uint64_t seed) { { Algo::StreamInit(seed) } noexcept -> std::same_as; { Algo::StreamUpdate(state, data) } noexcept; { Algo::StreamFinalize(state) } noexcept -> std::same_as; @@ -166,7 +166,7 @@ class Streamer { [[nodiscard]] constexpr uint64_t Finalize() const noexcept { return Algo::StreamFinalize(state_); } private: - typename Algo::StreamState state_; + Algo::StreamState state_; }; // The selected default algorithms behind the `mbo::hash` entry points. diff --git a/mbo/json/json.h b/mbo/json/json.h index 1ea7e58c..972e684d 100644 --- a/mbo/json/json.h +++ b/mbo/json/json.h @@ -415,7 +415,7 @@ class Json { } // Change value to an `Array`. - Json& MakeArray() { return MakeType(std::make_unique()); } + Json& MakeArray() { return MakeType(std::make_unique()); } // Change value to an `Object` Json& MakeObject() { return MakeType(Object{}); } diff --git a/mbo/testing/status.h b/mbo/testing/status.h index defe36ee..a0c9e6a7 100644 --- a/mbo/testing/status.h +++ b/mbo/testing/status.h @@ -79,7 +79,7 @@ template class IsOkAndHoldsMatcherImpl : public ::testing::MatcherInterface { public: // NOLINTNEXTLINE(readability-identifier-naming) - using value_type = typename std::remove_reference::type::value_type; + using value_type = std::remove_reference::type::value_type; template, int> = 0> explicit IsOkAndHoldsMatcherImpl(InnerMatcher&& inner_matcher) diff --git a/mbo/types/cases.h b/mbo/types/cases.h index 46f2550f..5112aa4b 100644 --- a/mbo/types/cases.h +++ b/mbo/types/cases.h @@ -63,7 +63,7 @@ using types_internal::IfFalseThenVoid; // `Cases, IfThen, IfElse>` // template -using Cases = typename types_internal::CasesImpl::type; +using Cases = types_internal::CasesImpl::type; // Evaluates the first non zero case (1-based, 0 if all zero). // diff --git a/mbo/types/container_proxy.h b/mbo/types/container_proxy.h index e986cb5f..7b42bbb7 100644 --- a/mbo/types/container_proxy.h +++ b/mbo/types/container_proxy.h @@ -58,7 +58,7 @@ namespace mbo::types { // ``` template< typename T, - typename Container = typename T::element_type, + typename Container = T::element_type, Container& (T::*GetMutable)() = &T::operator*, const Container& (T::*GetConst)() const = &T::operator*> requires requires { typename std::remove_cvref_t::value_type; } @@ -78,8 +78,8 @@ struct ContainerProxy : T { } public: - using size_type = typename C::size_type; - using value_type = typename C::value_type; + using size_type = C::size_type; + using value_type = C::value_type; // NOLINTBEGIN(readability-identifier-naming) // clang-format off diff --git a/mbo/types/extender.h b/mbo/types/extender.h index 45a818f0..d89ab84f 100644 --- a/mbo/types/extender.h +++ b/mbo/types/extender.h @@ -132,13 +132,13 @@ struct MakeExtender { template struct Impl : ImplT { - using Type = typename ExtenderOrActualType::Type; + using Type = ExtenderOrActualType::Type; }; }; template struct AbslStringify_ : ExtenderBase { // NOLINT(readability-identifier-naming) - using Type = typename ExtenderBase::Type; + using Type = ExtenderBase::Type; template friend struct AbslStringify_; @@ -164,7 +164,7 @@ struct AbslStringify_ : ExtenderBase { // NOLINT(readability-identifier-naming) template struct AbslHashable_ : ExtenderBase { // NOLINT(readability-identifier-naming) private: - using T = typename ExtenderBase::Type; + using T = ExtenderBase::Type; public: template @@ -176,7 +176,7 @@ struct AbslHashable_ : ExtenderBase { // NOLINT(readability-identifier-naming) template struct Comparable_ : ExtenderBase { // NOLINT(readability-identifier-naming) private: - using T = typename ExtenderBase::Type; + using T = ExtenderBase::Type; public: // Define operator `<=>` on `const T&` since that is what defines the @@ -232,7 +232,7 @@ struct Comparable_ : ExtenderBase { // NOLINT(readability-identifier-naming) template struct Printable_ : ExtenderBase { // NOLINT(readability-identifier-naming) public: - using T = typename ExtenderBase::Type; + using T = ExtenderBase::Type; // Produce a string based on control via `field_options`. // diff --git a/mbo/types/internal/extend.h b/mbo/types/internal/extend.h index 8f4695de..1d12a92a 100644 --- a/mbo/types/internal/extend.h +++ b/mbo/types/internal/extend.h @@ -67,14 +67,14 @@ struct GetRequirementImpl { template struct GetRequirementImpl { - using type = typename Extender::RequiredExtender; + using type = Extender::RequiredExtender; }; template -using GetRequirement = typename GetRequirementImpl::type; +using GetRequirement = GetRequirementImpl::type; template -using GetType = typename std::tuple_element>::type; +using GetType = std::tuple_element>::type; template struct RequiredPresentForIndexImpl @@ -116,7 +116,7 @@ concept HasExtenderTuple = requires { typename T::ExtenderTuple; }; // There is also the special case of a shorthand extender which has a `ExtenderTuple` member type. template> struct ExtendExtenderTupleElemT { - using type = typename T::ExtenderTuple; + using type = T::ExtenderTuple; }; template diff --git a/mbo/types/internal/is_braces_constructible.h b/mbo/types/internal/is_braces_constructible.h index 37414075..0858f100 100644 --- a/mbo/types/internal/is_braces_constructible.h +++ b/mbo/types/internal/is_braces_constructible.h @@ -127,7 +127,7 @@ template struct IsBracesConstructibleImpl : decltype(types_internal::IsBracesConstructibleFunc(0)) {}; template -using IsBracesConstructibleImplT = typename IsBracesConstructibleImpl::type; +using IsBracesConstructibleImplT = IsBracesConstructibleImpl::type; #ifdef __clang__ # pragma clang diagnostic pop diff --git a/mbo/types/internal/test_types.h b/mbo/types/internal/test_types.h index 0bad3fd0..98cd0490 100644 --- a/mbo/types/internal/test_types.h +++ b/mbo/types/internal/test_types.h @@ -51,7 +51,7 @@ struct BaseOutOfRange final { }; template -using ConstructBase = typename CasesImpl< +using ConstructBase = CasesImpl< IfThen, IfThen, IfThen, @@ -100,7 +100,7 @@ struct DerivedOutOfRange final { }; template -using ConstructType = typename CasesImpl< +using ConstructType = CasesImpl< IfThen>>, IfThen>>, IfThen>>, @@ -190,7 +190,7 @@ struct Base3B { }; template -using ConstructBase2 = typename CasesImpl< +using ConstructBase2 = CasesImpl< IfThen, IfThen, IfThen, @@ -198,7 +198,7 @@ using ConstructBase2 = typename CasesImpl< IfElse>::type; template -using ConstructMultiType = typename CasesImpl< +using ConstructMultiType = CasesImpl< IfThen, ConstructBase2>>, IfThen, ConstructBase2>>, IfThen, ConstructBase2>>, diff --git a/mbo/types/optional_data_or_ref_test.cc b/mbo/types/optional_data_or_ref_test.cc index 2ec831fd..296eeb72 100644 --- a/mbo/types/optional_data_or_ref_test.cc +++ b/mbo/types/optional_data_or_ref_test.cc @@ -104,7 +104,7 @@ TEST_F(OptionalDataOrRefTest, InitRef) { TEST_F(OptionalDataOrRefTest, Value) { int val = 10; - static_assert(std::same_as::value_type>); + static_assert(std::same_as::value_type>); OptionalDataOrRef ref(val); EXPECT_THAT(ref.has_value(), true); EXPECT_THAT(ref.HoldsData(), false);