diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-04-12 18:24:59 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-04-12 18:24:59 +0000 |
commit | fc99b1ad515ccfc92ee92001c409f69385033af5 (patch) | |
tree | c8732acb1a441408870c5e816a3afd01ae1f2e62 /include/gtest/internal/gtest-port.h | |
parent | e9adbcbb56a205dee270842f7d6221c52d508476 (diff) | |
download | googletest-fc99b1ad515ccfc92ee92001c409f69385033af5.tar.gz googletest-fc99b1ad515ccfc92ee92001c409f69385033af5.tar.bz2 googletest-fc99b1ad515ccfc92ee92001c409f69385033af5.zip |
Avoids iterator_traits, as it's not available in libCStd when compiled with Sun C++.
Diffstat (limited to 'include/gtest/internal/gtest-port.h')
-rw-r--r-- | include/gtest/internal/gtest-port.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h index 53cf8248..d2bc6cb8 100644 --- a/include/gtest/internal/gtest-port.h +++ b/include/gtest/internal/gtest-port.h @@ -140,6 +140,8 @@ // // Template meta programming: // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only. +// IteratorTraits - partial implementation of std::iterator_traits, which +// is not available in libCstd when compiled with Sun C++. // // Smart pointers: // scoped_ptr - as in TR2. @@ -1466,6 +1468,21 @@ struct is_pointer : public false_type {}; template <typename T> struct is_pointer<T*> : public true_type {}; +template <typename Iterator> +struct IteratorTraits { + typedef typename Iterator::value_type value_type; +}; + +template <typename T> +struct IteratorTraits<T*> { + typedef T value_type; +}; + +template <typename T> +struct IteratorTraits<const T*> { + typedef T value_type; +}; + #if GTEST_OS_WINDOWS # define GTEST_PATH_SEP_ "\\" # define GTEST_HAS_ALT_PATH_SEP_ 1 |