diff options
author | Krystian Kuzniarek <krystian.kuzniarek@gmail.com> | 2019-08-13 21:59:59 (GMT) |
---|---|---|
committer | Krystian Kuzniarek <krystian.kuzniarek@gmail.com> | 2019-08-13 22:34:04 (GMT) |
commit | 364839ab142e5d6e4efc89953e0911267d7c5502 (patch) | |
tree | 67c1a6ebc130deb0797747e64b26b8a6083b2808 /googletest/include/gtest/internal/gtest-internal.h | |
parent | 90a443f9c2437ca8a682a1ac625eba64e1d74a8a (diff) | |
download | googletest-364839ab142e5d6e4efc89953e0911267d7c5502.zip googletest-364839ab142e5d6e4efc89953e0911267d7c5502.tar.gz googletest-364839ab142e5d6e4efc89953e0911267d7c5502.tar.bz2 |
remove a custom implementation of std::remove_constrefs/pull/2393/head
Diffstat (limited to 'googletest/include/gtest/internal/gtest-internal.h')
-rw-r--r-- | googletest/include/gtest/internal/gtest-internal.h | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index 08531d8..af7cd33 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -869,30 +869,9 @@ struct RemoveReference<T&> { typedef T type; }; // NOLINT #define GTEST_REMOVE_REFERENCE_(T) \ typename ::testing::internal::RemoveReference<T>::type -// Removes const from a type if it is a const type, otherwise leaves -// it unchanged. This is the same as tr1::remove_const, which is not -// widely available yet. -template <typename T> -struct RemoveConst { typedef T type; }; // NOLINT -template <typename T> -struct RemoveConst<const T> { typedef T type; }; // NOLINT - -// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above -// definition to fail to remove the const in 'const int[3]' and 'const -// char[3][4]'. The following specialization works around the bug. -template <typename T, size_t N> -struct RemoveConst<const T[N]> { - typedef typename RemoveConst<T>::type type[N]; -}; - -// A handy wrapper around RemoveConst that works when the argument -// T depends on template parameters. -#define GTEST_REMOVE_CONST_(T) \ - typename ::testing::internal::RemoveConst<T>::type - // Turns const U&, U&, const U, and U all into U. #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \ - GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T)) + typename std::remove_const<GTEST_REMOVE_REFERENCE_(T)>::type // IsAProtocolMessage<T>::value is a compile-time bool constant that's // true if T is type proto2::Message or a subclass of it. |