Skip to content

Commit

Permalink
Merge pull request #4374 from masbug:main
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 568317621
Change-Id: Icf7fb519f96f5e88eb0df491eed143134c8ac6eb
  • Loading branch information
copybara-github committed Sep 25, 2023
2 parents e40661d + e27b194 commit 5bd0f08
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions googlemock/include/gmock/gmock-function-mocker.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_FUNCTION_MOCKER_H_
#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_FUNCTION_MOCKER_H_

#include <cstddef>
#include <type_traits> // IWYU pragma: keep
#include <utility> // IWYU pragma: keep

Expand Down Expand Up @@ -69,22 +70,22 @@ constexpr bool PrefixOf(const char* a, const char* b) {
return *a == 0 || (*a == *b && internal::PrefixOf(a + 1, b + 1));
}

template <int N, int M>
template <size_t N, size_t M>
constexpr bool StartsWith(const char (&prefix)[N], const char (&str)[M]) {
return N <= M && internal::PrefixOf(prefix, str);
}

template <int N, int M>
template <size_t N, size_t M>
constexpr bool EndsWith(const char (&suffix)[N], const char (&str)[M]) {
return N <= M && internal::PrefixOf(suffix, str + M - N);
}

template <int N, int M>
template <size_t N, size_t M>
constexpr bool Equals(const char (&a)[N], const char (&b)[M]) {
return N == M && internal::PrefixOf(a, b);
}

template <int N>
template <size_t N>
constexpr bool ValidateSpec(const char (&spec)[N]) {
return internal::Equals("const", spec) ||
internal::Equals("override", spec) ||
Expand Down

0 comments on commit 5bd0f08

Please sign in to comment.