diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index 258397a4f..2982c244e 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -194,11 +194,11 @@ using LosslessArithmeticConvertibleImpl = std::integral_constant< // Converting between integers of different widths is allowed so long // as the conversion does not go from signed to unsigned. (((sizeof(From) < sizeof(To)) && - !(std::is_signed::value && !std::is_signed::value)) || + !(std::is_signed_v && !std::is_signed_v)) || // Converting between integers of the same width only requires the // two types to have the same signedness. ((sizeof(From) == sizeof(To)) && - (std::is_signed::value == std::is_signed::value))) + (std::is_signed_v == std::is_signed_v))) ) ? true // Floating point conversions are lossless if and only if `To` is at least // as wide as `From`. @@ -364,7 +364,7 @@ class [[nodiscard]] StlContainerView { typedef const type& const_reference; static const_reference ConstReference(const RawContainer& container) { - static_assert(!std::is_const::value, + static_assert(!std::is_const_v, "RawContainer type must not be const"); return container; } @@ -385,7 +385,7 @@ class [[nodiscard]] StlContainerView { typedef const type const_reference; static const_reference ConstReference(const Element (&array)[N]) { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "Element type must not be const"); return type(array, N, RelationToSourceReference()); } @@ -447,14 +447,13 @@ auto ApplyImpl(F&& f, Tuple&& args, std::index_sequence) // Apply the function to a tuple of arguments. template -auto Apply(F&& f, Tuple&& args) - -> decltype(ApplyImpl( - std::forward(f), std::forward(args), - std::make_index_sequence::type>::value>())) { +auto Apply(F&& f, Tuple&& args) -> decltype(ApplyImpl( + std::forward(f), std::forward(args), + std::make_index_sequence< + std::tuple_size_v>>())) { return ApplyImpl(std::forward(f), std::forward(args), - std::make_index_sequence::type>::value>()); + std::make_index_sequence< + std::tuple_size_v>>()); } // Template struct Function, where F must be a function type, contains @@ -490,7 +489,7 @@ struct Function { // See: https://github.com/google/googletest/issues/3931 // Can be replaced with std::tuple_element_t in C++14. template -using TupleElement = typename std::tuple_element::type; +using TupleElement = std::tuple_element_t; bool Base64Unescape(const std::string& encoded, std::string* decoded);