remove a custom implementation of std::enable_if
This commit is contained in:
parent
90a443f9c2
commit
11471da793
@ -42,6 +42,7 @@
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#include "gtest/gtest-printers.h"
|
||||
#include "gtest/internal/gtest-internal.h"
|
||||
@ -299,8 +300,8 @@ class MatcherBase {
|
||||
template <typename U>
|
||||
explicit MatcherBase(
|
||||
const MatcherInterface<U>* impl,
|
||||
typename internal::EnableIf<
|
||||
!internal::IsSame<U, const U&>::value>::type* = nullptr)
|
||||
typename std::enable_if<!internal::IsSame<U, const U&>::value>::type* =
|
||||
nullptr)
|
||||
: impl_(new internal::MatcherInterfaceAdapter<U>(impl)) {}
|
||||
|
||||
MatcherBase(const MatcherBase&) = default;
|
||||
@ -333,9 +334,10 @@ class Matcher : public internal::MatcherBase<T> {
|
||||
: internal::MatcherBase<T>(impl) {}
|
||||
|
||||
template <typename U>
|
||||
explicit Matcher(const MatcherInterface<U>* impl,
|
||||
typename internal::EnableIf<
|
||||
!internal::IsSame<U, const U&>::value>::type* = nullptr)
|
||||
explicit Matcher(
|
||||
const MatcherInterface<U>* impl,
|
||||
typename std::enable_if<!internal::IsSame<U, const U&>::value>::type* =
|
||||
nullptr)
|
||||
: internal::MatcherBase<T>(impl) {}
|
||||
|
||||
// Implicit constructor here allows people to write
|
||||
|
@ -292,7 +292,7 @@ class GTEST_API_ AssertionResult {
|
||||
template <typename T>
|
||||
explicit AssertionResult(
|
||||
const T& success,
|
||||
typename internal::EnableIf<
|
||||
typename std::enable_if<
|
||||
!std::is_convertible<T, AssertionResult>::value>::type*
|
||||
/*enabler*/
|
||||
= nullptr)
|
||||
|
@ -991,13 +991,6 @@ struct IsRecursiveContainerImpl<C, true> {
|
||||
template <typename C>
|
||||
struct IsRecursiveContainer : public IsRecursiveContainerImpl<C>::type {};
|
||||
|
||||
// EnableIf<condition>::type is void when 'Cond' is true, and
|
||||
// undefined when 'Cond' is false. To use SFINAE to make a function
|
||||
// overload only apply when a particular expression is true, add
|
||||
// "typename EnableIf<expression>::type* = 0" as the last parameter.
|
||||
template<bool> struct EnableIf;
|
||||
template<> struct EnableIf<true> { typedef void type; }; // NOLINT
|
||||
|
||||
// Utilities for native arrays.
|
||||
|
||||
// ArrayEq() compares two k-dimensional native arrays using the
|
||||
|
Loading…
Reference in New Issue
Block a user