Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
9af267d2
Commit
9af267d2
authored
May 13, 2010
by
vladlosev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaces UniversalPrinter<T>::Print(x, os) with UniversalPrint(x, os) as…
Replaces UniversalPrinter<T>::Print(x, os) with UniversalPrint(x, os) as appropriate (by Zhanyong Wan).
parent
7aec2f36
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
gtest-printers.h
include/gtest/gtest-printers.h
+7
-5
No files found.
include/gtest/gtest-printers.h
View file @
9af267d2
...
@@ -395,10 +395,10 @@ inline void PrintTo(wchar_t* s, ::std::ostream* os) {
...
@@ -395,10 +395,10 @@ inline void PrintTo(wchar_t* s, ::std::ostream* os) {
// the curly braces.
// the curly braces.
template
<
typename
T
>
template
<
typename
T
>
void
PrintRawArrayTo
(
const
T
a
[],
size_t
count
,
::
std
::
ostream
*
os
)
{
void
PrintRawArrayTo
(
const
T
a
[],
size_t
count
,
::
std
::
ostream
*
os
)
{
UniversalPrint
er
<
T
>::
Print
(
a
[
0
],
os
);
UniversalPrint
(
a
[
0
],
os
);
for
(
size_t
i
=
1
;
i
!=
count
;
i
++
)
{
for
(
size_t
i
=
1
;
i
!=
count
;
i
++
)
{
*
os
<<
", "
;
*
os
<<
", "
;
UniversalPrint
er
<
T
>::
Print
(
a
[
i
],
os
);
UniversalPrint
(
a
[
i
],
os
);
}
}
}
}
...
@@ -515,6 +515,8 @@ void PrintTo(
...
@@ -515,6 +515,8 @@ void PrintTo(
template
<
typename
T1
,
typename
T2
>
template
<
typename
T1
,
typename
T2
>
void
PrintTo
(
const
::
std
::
pair
<
T1
,
T2
>&
value
,
::
std
::
ostream
*
os
)
{
void
PrintTo
(
const
::
std
::
pair
<
T1
,
T2
>&
value
,
::
std
::
ostream
*
os
)
{
*
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
);
UniversalPrinter
<
T1
>::
Print
(
value
.
first
,
os
);
*
os
<<
", "
;
*
os
<<
", "
;
UniversalPrinter
<
T2
>::
Print
(
value
.
second
,
os
);
UniversalPrinter
<
T2
>::
Print
(
value
.
second
,
os
);
...
@@ -610,7 +612,7 @@ class UniversalPrinter<T&> {
...
@@ -610,7 +612,7 @@ class UniversalPrinter<T&> {
*
os
<<
"@"
<<
reinterpret_cast
<
const
void
*>
(
&
value
)
<<
" "
;
*
os
<<
"@"
<<
reinterpret_cast
<
const
void
*>
(
&
value
)
<<
" "
;
// Then prints the value itself.
// Then prints the value itself.
UniversalPrint
er
<
T
>::
Print
(
value
,
os
);
UniversalPrint
(
value
,
os
);
}
}
#ifdef _MSC_VER
#ifdef _MSC_VER
...
@@ -623,13 +625,13 @@ class UniversalPrinter<T&> {
...
@@ -623,13 +625,13 @@ class UniversalPrinter<T&> {
// NUL-terminated string (but not the pointer) is printed.
// NUL-terminated string (but not the pointer) is printed.
template
<
typename
T
>
template
<
typename
T
>
void
UniversalTersePrint
(
const
T
&
value
,
::
std
::
ostream
*
os
)
{
void
UniversalTersePrint
(
const
T
&
value
,
::
std
::
ostream
*
os
)
{
UniversalPrint
er
<
T
>::
Print
(
value
,
os
);
UniversalPrint
(
value
,
os
);
}
}
inline
void
UniversalTersePrint
(
const
char
*
str
,
::
std
::
ostream
*
os
)
{
inline
void
UniversalTersePrint
(
const
char
*
str
,
::
std
::
ostream
*
os
)
{
if
(
str
==
NULL
)
{
if
(
str
==
NULL
)
{
*
os
<<
"NULL"
;
*
os
<<
"NULL"
;
}
else
{
}
else
{
UniversalPrint
er
<
string
>::
Print
(
string
(
str
),
os
);
UniversalPrint
(
string
(
str
),
os
);
}
}
}
}
inline
void
UniversalTersePrint
(
char
*
str
,
::
std
::
ostream
*
os
)
{
inline
void
UniversalTersePrint
(
char
*
str
,
::
std
::
ostream
*
os
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment