summaryrefslogtreecommitdiff
path: root/include/gtest/gtest-printers.h
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-05-13 18:00:59 +0000
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-05-13 18:00:59 +0000
commit25fbd3d4e2d8879a325868c4a33056910a05b2b9 (patch)
tree73111a6c8f4cd1d08e48e53f0d8383eaf6032779 /include/gtest/gtest-printers.h
parentbcb7b521c85b3957eeeb2b72982651eca9357263 (diff)
downloadgoogletest-25fbd3d4e2d8879a325868c4a33056910a05b2b9.tar.gz
Replaces UniversalPrinter<T>::Print(x, os) with UniversalPrint(x, os) as appropriate (by Zhanyong Wan).
git-svn-id: http://googletest.googlecode.com/svn/trunk@429 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'include/gtest/gtest-printers.h')
-rw-r--r--include/gtest/gtest-printers.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/gtest/gtest-printers.h b/include/gtest/gtest-printers.h
index b15e366..0466c9c 100644
--- a/include/gtest/gtest-printers.h
+++ b/include/gtest/gtest-printers.h
@@ -395,10 +395,10 @@ inline void PrintTo(wchar_t* s, ::std::ostream* os) {
// the curly braces.
template <typename T>
void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
- UniversalPrinter<T>::Print(a[0], os);
+ UniversalPrint(a[0], os);
for (size_t i = 1; i != count; i++) {
*os << ", ";
- UniversalPrinter<T>::Print(a[i], os);
+ UniversalPrint(a[i], os);
}
}
@@ -515,6 +515,8 @@ void PrintTo(
template <typename T1, typename T2>
void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
*os << '(';
+ // We cannot use UniversalPrint(value.first, os) here, as T1 may be
+ // a reference type. The same for printing value.second.
UniversalPrinter<T1>::Print(value.first, os);
*os << ", ";
UniversalPrinter<T2>::Print(value.second, os);
@@ -610,7 +612,7 @@ class UniversalPrinter<T&> {
*os << "@" << reinterpret_cast<const void*>(&value) << " ";
// Then prints the value itself.
- UniversalPrinter<T>::Print(value, os);
+ UniversalPrint(value, os);
}
#ifdef _MSC_VER
@@ -623,13 +625,13 @@ class UniversalPrinter<T&> {
// NUL-terminated string (but not the pointer) is printed.
template <typename T>
void UniversalTersePrint(const T& value, ::std::ostream* os) {
- UniversalPrinter<T>::Print(value, os);
+ UniversalPrint(value, os);
}
inline void UniversalTersePrint(const char* str, ::std::ostream* os) {
if (str == NULL) {
*os << "NULL";
} else {
- UniversalPrinter<string>::Print(string(str), os);
+ UniversalPrint(string(str), os);
}
}
inline void UniversalTersePrint(char* str, ::std::ostream* os) {