Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mbo/container/any_scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class AnyScanImpl {
requires(mbo::types::IsPair<std::remove_cvref_t<Pair>>)
struct FirstType {
using RawPair = std::remove_cvref_t<Pair>;
using RawFirst = typename RawPair::first_type;
using RawFirst = RawPair::first_type;
using type = mbo::types::Cases<
mbo::types::IfThen<std::is_const_v<Pair> && std::is_reference_v<Pair>, const RawFirst&>,
mbo::types::IfThen<std::is_const_v<Pair>, const RawFirst>,
Expand All @@ -317,8 +317,8 @@ class AnyScanImpl {
using RawSrc = std::remove_cvref_t<SrcValueTypeT>;
using RawDst = std::remove_cvref_t<DstAccessType>;
if constexpr (::mbo::types::IsPair<RawSrc> && ::mbo::types::IsPair<RawDst>) {
using SrcFirstType = typename FirstType<SrcValueTypeT>::type;
using DstFirstType = typename FirstType<DstAccessType>::type;
using SrcFirstType = FirstType<SrcValueTypeT>::type;
using DstFirstType = FirstType<DstAccessType>::type;
static_assert(
std::convertible_to<SrcFirstType, DstFirstType>,
"A common reason for this to fail is scanning over `std::map` and similar indexed containers "
Expand Down
4 changes: 2 additions & 2 deletions mbo/digest/digest.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ template<typename Algo>
requires(IsDigestAlgorithm<Algo> && HasStreaming<Algo>)
class Streamer {
public:
using DigestType = typename Algo::DigestType;
using DigestType = Algo::DigestType;

constexpr Streamer() noexcept : state_(Algo::StreamInit()) {}

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mbo/digest/digest_concepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename Algo>
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<typename Algo::StreamState>;
{ Algo::StreamUpdate(state, data) } noexcept;
{ Algo::StreamFinalize(state) } noexcept -> std::same_as<typename Algo::DigestType>;
Expand Down
8 changes: 4 additions & 4 deletions mbo/digest/digest_hmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ requires(IsDigestAlgorithm<Algo> && HasStreaming<Algo>)
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<char, kBlockSize> opad = {};
};

Expand Down Expand Up @@ -116,7 +116,7 @@ template<typename Algo>
requires(IsDigestAlgorithm<Algo> && HasStreaming<Algo>)
class HmacStreamer {
public:
using DigestType = typename Algo::DigestType;
using DigestType = Algo::DigestType;

constexpr explicit HmacStreamer(std::string_view key) noexcept : state_(Hmac<Algo>::StreamInit(key)) {}

Expand All @@ -128,7 +128,7 @@ class HmacStreamer {
[[nodiscard]] constexpr DigestType Finalize() const noexcept { return Hmac<Algo>::StreamFinalize(state_); }

private:
typename Hmac<Algo>::StreamState state_;
Hmac<Algo>::StreamState state_;
};

// NOLINTEND(*-magic-numbers,*-easily-swappable-parameters,*-constant-array-index)
Expand Down
4 changes: 2 additions & 2 deletions mbo/hash/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct Hasher {
// (e.g. rapidhash in hash_extra.h has no canonical streaming form) -- absence
// is honest.
template<typename Algo>
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<typename Algo::StreamState>;
{ Algo::StreamUpdate(state, data) } noexcept;
{ Algo::StreamFinalize(state) } noexcept -> std::same_as<uint64_t>;
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion mbo/json/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class Json {
}

// Change value to an `Array`.
Json& MakeArray() { return MakeType(std::make_unique<typename Array::element_type>()); }
Json& MakeArray() { return MakeType(std::make_unique<Array::element_type>()); }

// Change value to an `Object`
Json& MakeObject() { return MakeType(Object{}); }
Expand Down
2 changes: 1 addition & 1 deletion mbo/testing/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ template<typename StatusOrType>
class IsOkAndHoldsMatcherImpl : public ::testing::MatcherInterface<StatusOrType> {
public:
// NOLINTNEXTLINE(readability-identifier-naming)
using value_type = typename std::remove_reference<StatusOrType>::type::value_type;
using value_type = std::remove_reference<StatusOrType>::type::value_type;

template<typename InnerMatcher, std::enable_if_t<!std::is_same_v<InnerMatcher, IsOkAndHoldsMatcherImpl>, int> = 0>
explicit IsOkAndHoldsMatcherImpl(InnerMatcher&& inner_matcher)
Expand Down
2 changes: 1 addition & 1 deletion mbo/types/cases.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ using types_internal::IfFalseThenVoid;
// `Cases<IfThen<cond1, type1>, IfThen<cond2, type2>, IfElse<default_type>>`
//
template<typename... IfThenCases>
using Cases = typename types_internal::CasesImpl<IfThenCases...>::type;
using Cases = types_internal::CasesImpl<IfThenCases...>::type;

// Evaluates the first non zero case (1-based, 0 if all zero).
//
Expand Down
6 changes: 3 additions & 3 deletions mbo/types/container_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Container>::value_type; }
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions mbo/types/extender.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ struct MakeExtender {

template<typename ExtenderOrActualType>
struct Impl : ImplT<ExtenderOrActualType> {
using Type = typename ExtenderOrActualType::Type;
using Type = ExtenderOrActualType::Type;
};
};

template<typename ExtenderBase>
struct AbslStringify_ : ExtenderBase { // NOLINT(readability-identifier-naming)
using Type = typename ExtenderBase::Type;
using Type = ExtenderBase::Type;

template<typename Other>
friend struct AbslStringify_;
Expand All @@ -164,7 +164,7 @@ struct AbslStringify_ : ExtenderBase { // NOLINT(readability-identifier-naming)
template<typename ExtenderBase>
struct AbslHashable_ : ExtenderBase { // NOLINT(readability-identifier-naming)
private:
using T = typename ExtenderBase::Type;
using T = ExtenderBase::Type;

public:
template<typename H>
Expand All @@ -176,7 +176,7 @@ struct AbslHashable_ : ExtenderBase { // NOLINT(readability-identifier-naming)
template<typename ExtenderBase>
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
Expand Down Expand Up @@ -232,7 +232,7 @@ struct Comparable_ : ExtenderBase { // NOLINT(readability-identifier-naming)
template<typename ExtenderBase>
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`.
//
Expand Down
8 changes: 4 additions & 4 deletions mbo/types/internal/extend.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ struct GetRequirementImpl {

template<typename Extender>
struct GetRequirementImpl<Extender, true> {
using type = typename Extender::RequiredExtender;
using type = Extender::RequiredExtender;
};

template<typename Extender>
using GetRequirement = typename GetRequirementImpl<Extender>::type;
using GetRequirement = GetRequirementImpl<Extender>::type;

template<std::size_t N, typename... Ts>
using GetType = typename std::tuple_element<N, std::tuple<Ts...>>::type;
using GetType = std::tuple_element<N, std::tuple<Ts...>>::type;

template<std::size_t N, typename Required, typename... Extenders>
struct RequiredPresentForIndexImpl
Expand Down Expand Up @@ -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<typename T, bool = HasExtenderTuple<T>>
struct ExtendExtenderTupleElemT {
using type = typename T::ExtenderTuple;
using type = T::ExtenderTuple;
};

template<typename T>
Expand Down
2 changes: 1 addition & 1 deletion mbo/types/internal/is_braces_constructible.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ template<typename T, typename... Args>
struct IsBracesConstructibleImpl : decltype(types_internal::IsBracesConstructibleFunc<T, Args...>(0)) {};

template<typename T, typename... Args>
using IsBracesConstructibleImplT = typename IsBracesConstructibleImpl<T, Args...>::type;
using IsBracesConstructibleImplT = IsBracesConstructibleImpl<T, Args...>::type;

#ifdef __clang__
# pragma clang diagnostic pop
Expand Down
8 changes: 4 additions & 4 deletions mbo/types/internal/test_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct BaseOutOfRange final {
};

template<std::size_t base>
using ConstructBase = typename CasesImpl<
using ConstructBase = CasesImpl<
IfThen<base == 0, Empty>,
IfThen<base == 1, Base1>,
IfThen<base == 2, Base1>,
Expand Down Expand Up @@ -100,7 +100,7 @@ struct DerivedOutOfRange final {
};

template<std::size_t derived, std::size_t base>
using ConstructType = typename CasesImpl<
using ConstructType = CasesImpl<
IfThen<derived == 0, Derived0<ConstructBase<base>>>,
IfThen<derived == 1, Derived1<ConstructBase<base>>>,
IfThen<derived == 2, Derived2<ConstructBase<base>>>,
Expand Down Expand Up @@ -190,15 +190,15 @@ struct Base3B {
};

template<std::size_t base>
using ConstructBase2 = typename CasesImpl<
using ConstructBase2 = CasesImpl<
IfThen<base == 0, EmptyB>,
IfThen<base == 1, Base2B>,
IfThen<base == 2, Base2B>,
IfThen<base == 3, Base3B>,
IfElse<BaseOutOfRange>>::type;

template<std::size_t derived, std::size_t a, std::size_t b>
using ConstructMultiType = typename CasesImpl<
using ConstructMultiType = CasesImpl<
IfThen<derived == 0, Multi0<ConstructBase<a>, ConstructBase2<b>>>,
IfThen<derived == 1, Multi1<ConstructBase<a>, ConstructBase2<b>>>,
IfThen<derived == 2, Multi2<ConstructBase<a>, ConstructBase2<b>>>,
Expand Down
2 changes: 1 addition & 1 deletion mbo/types/optional_data_or_ref_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ TEST_F(OptionalDataOrRefTest, InitRef) {

TEST_F(OptionalDataOrRefTest, Value) {
int val = 10;
static_assert(std::same_as<int, typename OptionalDataOrRef<int>::value_type>);
static_assert(std::same_as<int, OptionalDataOrRef<int>::value_type>);
OptionalDataOrRef<int> ref(val);
EXPECT_THAT(ref.has_value(), true);
EXPECT_THAT(ref.HoldsData(), false);
Expand Down
Loading