| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 74e3aa2 commit 2e500ba
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -161,8 +161,7 @@ class GTEST_API_ [[nodiscard]] AssertionResult { | |||
| 161 | 161 | template <typename T> | |
| 162 | 162 | explicit AssertionResult( | |
| 163 | 163 | const T& success, | |
| 164 | - typename std::enable_if< | ||
| 165 | - !std::is_convertible<T, AssertionResult>::value>::type* | ||
| 164 | + std::enable_if_t<!std::is_convertible_v<T, AssertionResult>>* | ||
| 166 | 165 | /*enabler*/ | |
| 167 | 166 | = nullptr) | |
| 168 | 167 | : success_(success) {} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -277,8 +277,8 @@ class [[nodiscard]] MatcherBase : private MatcherDescriberInterface { | |||
| 277 | 277 | Init(impl); | |
| 278 | 278 | } | |
| 279 | 279 | ||
| 280 | - template <typename M, typename = typename std::remove_reference< | ||
| 281 | - M>::type::is_gtest_matcher> | ||
| 280 | + template <typename M, | ||
| 281 | + typename = typename std::remove_reference_t<M>::is_gtest_matcher> | ||
| 282 | 282 | MatcherBase(M&& m) : vtable_(nullptr), buffer_() { // NOLINT | |
| 283 | 283 | Init(std::forward<M>(m)); | |
| 284 | 284 | } | |
@@ -363,11 +363,10 @@ class [[nodiscard]] MatcherBase : private MatcherDescriberInterface { | |||
| 363 | 363 | // from the impl, but some users really want to get their impl back when | |
| 364 | 364 | // they call GetDescriber(). | |
| 365 | 365 | // We use std::get on a tuple as a workaround of not having `if constexpr`. | |
| 366 | - return std::get<( | ||
| 367 | - std::is_convertible<decltype(&P::Get(m)), | ||
| 368 | - const MatcherDescriberInterface*>::value | ||
| 369 | - ? 1 | ||
| 370 | - : 0)>(std::make_tuple(&m, &P::Get(m))); | ||
| 366 | + return std::get<(std::is_convertible_v<decltype(&P::Get(m)), | ||
| 367 | + const MatcherDescriberInterface*> | ||
| 368 | + ? 1 | ||
| 369 | + : 0)>(std::make_tuple(&m, &P::Get(m))); | ||
| 371 | 370 | } | |
| 372 | 371 | ||
| 373 | 372 | template <typename P> | |
@@ -396,8 +395,8 @@ class [[nodiscard]] MatcherBase : private MatcherDescriberInterface { | |||
| 396 | 395 | template <typename M> | |
| 397 | 396 | static constexpr bool IsInlined() { | |
| 398 | 397 | return sizeof(M) <= sizeof(Buffer) && alignof(M) <= alignof(Buffer) && | |
| 399 | - std::is_trivially_copy_constructible<M>::value && | ||
| 400 | - std::is_trivially_destructible<M>::value; | ||
| 398 | + std::is_trivially_copy_constructible_v<M> && | ||
| 399 | + std::is_trivially_destructible_v<M>; | ||
| 401 | 400 | } | |
| 402 | 401 | ||
| 403 | 402 | template <typename M, bool = MatcherBase::IsInlined<M>()> | |
@@ -444,7 +443,7 @@ class [[nodiscard]] MatcherBase : private MatcherDescriberInterface { | |||
| 444 | 443 | ||
| 445 | 444 | template <typename M> | |
| 446 | 445 | void Init(M&& m) { | |
| 447 | - using MM = typename std::decay<M>::type; | ||
| 446 | + using MM = std::decay_t<M>; | ||
| 448 | 447 | using Policy = ValuePolicy<MM>; | |
| 449 | 448 | vtable_ = GetVTable<Policy>(); | |
| 450 | 449 | Policy::Init(*this, std::forward<M>(m)); | |
@@ -473,14 +472,12 @@ class [[nodiscard]] Matcher : public internal::MatcherBase<T> { | |||
| 473 | 472 | : internal::MatcherBase<T>(impl) {} | |
| 474 | 473 | ||
| 475 | 474 | template <typename U> | |
| 476 | - explicit Matcher( | ||
| 477 | - const MatcherInterface<U>* impl, | ||
| 478 | - typename std::enable_if<!std::is_same<U, const U&>::value>::type* = | ||
| 479 | - nullptr) | ||
| 475 | + explicit Matcher(const MatcherInterface<U>* impl, | ||
| 476 | + std::enable_if_t<!std::is_same_v<U, const U&>>* = nullptr) | ||
| 480 | 477 | : internal::MatcherBase<T>(impl) {} | |
| 481 | 478 | ||
| 482 | - template <typename M, typename = typename std::remove_reference< | ||
| 483 | - M>::type::is_gtest_matcher> | ||
| 479 | + template <typename M, | ||
| 480 | + typename = typename std::remove_reference_t<M>::is_gtest_matcher> | ||
| 484 | 481 | Matcher(M&& m) : internal::MatcherBase<T>(std::forward<M>(m)) {} // NOLINT | |
| 485 | 482 | ||
| 486 | 483 | // Implicit constructor here allows people to write | |
@@ -509,8 +506,8 @@ Matcher<const std::string&> : public internal::MatcherBase<const std::string&> { | |||
| 509 | 506 | explicit Matcher(const MatcherInterface<const std::string&>* impl) | |
| 510 | 507 | : internal::MatcherBase<const std::string&>(impl) {} | |
| 511 | 508 | ||
| 512 | - template <typename M, typename = typename std::remove_reference< | ||
| 513 | - M>::type::is_gtest_matcher> | ||
| 509 | + template <typename M, | ||
| 510 | + typename = typename std::remove_reference_t<M>::is_gtest_matcher> | ||
| 514 | 511 | Matcher(M&& m) // NOLINT | |
| 515 | 512 | : internal::MatcherBase<const std::string&>(std::forward<M>(m)) {} | |
| 516 | 513 | ||
@@ -533,8 +530,8 @@ Matcher<std::string> : public internal::MatcherBase<std::string> { | |||
| 533 | 530 | explicit Matcher(const MatcherInterface<std::string>* impl) | |
| 534 | 531 | : internal::MatcherBase<std::string>(impl) {} | |
| 535 | 532 | ||
| 536 | - template <typename M, typename = typename std::remove_reference< | ||
| 537 | - M>::type::is_gtest_matcher> | ||
| 533 | + template <typename M, | ||
| 534 | + typename = typename std::remove_reference_t<M>::is_gtest_matcher> | ||
| 538 | 535 | Matcher(M&& m) // NOLINT | |
| 539 | 536 | : internal::MatcherBase<std::string>(std::forward<M>(m)) {} | |
| 540 | 537 | ||
@@ -559,8 +556,8 @@ class GTEST_API_ [[nodiscard]] Matcher<const internal::StringView&> | |||
| 559 | 556 | explicit Matcher(const MatcherInterface<const internal::StringView&>* impl) | |
| 560 | 557 | : internal::MatcherBase<const internal::StringView&>(impl) {} | |
| 561 | 558 | ||
| 562 | - template <typename M, typename = typename std::remove_reference< | ||
| 563 | - M>::type::is_gtest_matcher> | ||
| 559 | + template <typename M, | ||
| 560 | + typename = typename std::remove_reference_t<M>::is_gtest_matcher> | ||
| 564 | 561 | Matcher(M&& m) // NOLINT | |
| 565 | 562 | : internal::MatcherBase<const internal::StringView&>(std::forward<M>(m)) { | |
| 566 | 563 | } | |
@@ -587,8 +584,8 @@ class GTEST_API_ [[nodiscard]] Matcher<internal::StringView> | |||
| 587 | 584 | explicit Matcher(const MatcherInterface<internal::StringView>* impl) | |
| 588 | 585 | : internal::MatcherBase<internal::StringView>(impl) {} | |
| 589 | 586 | ||
| 590 | - template <typename M, typename = typename std::remove_reference< | ||
| 591 | - M>::type::is_gtest_matcher> | ||
| 587 | + template <typename M, | ||
| 588 | + typename = typename std::remove_reference_t<M>::is_gtest_matcher> | ||
| 592 | 589 | Matcher(M&& m) // NOLINT | |
| 593 | 590 | : internal::MatcherBase<internal::StringView>(std::forward<M>(m)) {} | |
| 594 | 591 | ||
@@ -815,8 +812,8 @@ class [[nodiscard]] ImplicitCastEqMatcher { | |||
| 815 | 812 | StoredRhs stored_rhs_; | |
| 816 | 813 | }; | |
| 817 | 814 | ||
| 818 | - template <typename T, typename = typename std::enable_if< | ||
| 819 | - std::is_constructible<std::string, T>::value>::type> | ||
| 815 | + template <typename T, | ||
| 816 | + typename = std::enable_if_t<std::is_constructible_v<std::string, T>>> | ||
| 820 | 817 | using StringLike = T; | |
| 821 | 818 | ||
| 822 | 819 | // Implements polymorphic matchers MatchesRegex(regex) and | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -863,8 +863,8 @@ void PrintTupleTo(const T& t, std::integral_constant<size_t, I>, | |||
| 863 | 863 | GTEST_INTENTIONAL_CONST_COND_POP_() | |
| 864 | 864 | *os << ", "; | |
| 865 | 865 | } | |
| 866 | - UniversalPrinter<typename std::tuple_element<I - 1, T>::type>::Print( | ||
| 867 | - std::get<I - 1>(t), os); | ||
| 866 | + UniversalPrinter<std::tuple_element_t<I - 1, T>>::Print(std::get<I - 1>(t), | ||
| 867 | + os); | ||
| 868 | 868 | } | |
| 869 | 869 | ||
| 870 | 870 | template <typename... Types> | |
@@ -1218,7 +1218,7 @@ template <typename Tuple> | |||
| 1218 | 1218 | Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) { | |
| 1219 | 1219 | Strings result; | |
| 1220 | 1220 | TersePrintPrefixToStrings( | |
| 1221 | - value, std::integral_constant<size_t, std::tuple_size<Tuple>::value>(), | ||
| 1221 | + value, std::integral_constant<size_t, std::tuple_size_v<Tuple>>(), | ||
| 1222 | 1222 | &result); | |
| 1223 | 1223 | return result; | |
| 1224 | 1224 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2164,7 +2164,7 @@ class GTEST_API_ [[nodiscard]] ScopedTrace { | |||
| 2164 | 2164 | // to cause a compiler error. | |
| 2165 | 2165 | template <typename T1, typename T2> | |
| 2166 | 2166 | constexpr bool StaticAssertTypeEq() noexcept { | |
| 2167 | - static_assert(std::is_same<T1, T2>::value, "T1 and T2 are not the same type"); | ||
| 2167 | + static_assert(std::is_same_v<T1, T2>, "T1 and T2 are not the same type"); | ||
| 2168 | 2168 | return true; | |
| 2169 | 2169 | } | |
| 2170 | 2170 | ||
@@ -2310,7 +2310,7 @@ template <int&... ExplicitParameterBarrier, typename Factory> | |||
| 2310 | 2310 | TestInfo* RegisterTest(const char* test_suite_name, const char* test_name, | |
| 2311 | 2311 | const char* type_param, const char* value_param, | |
| 2312 | 2312 | const char* file, int line, Factory factory) { | |
| 2313 | - using TestT = typename std::remove_pointer<decltype(factory())>::type; | ||
| 2313 | + using TestT = std::remove_pointer_t<decltype(factory())>; | ||
| 2314 | 2314 | ||
| 2315 | 2315 | class FactoryImpl : public internal::TestFactoryBase { | |
| 2316 | 2316 | public: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments