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
9e38d77f
Commit
9e38d77f
authored
Jul 19, 2015
by
kosak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow the single-arg Values() overload to to conversions, just like every other
overload.
parent
7d7beaa1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
18 deletions
+6
-18
gtest-param-util-generated.h
include/gtest/internal/gtest-param-util-generated.h
+4
-1
gtest-param-util-generated.h.pump
include/gtest/internal/gtest-param-util-generated.h.pump
+2
-17
No files found.
include/gtest/internal/gtest-param-util-generated.h
View file @
9e38d77f
...
...
@@ -79,7 +79,10 @@ class ValueArray1 {
explicit
ValueArray1
(
T1
v1
)
:
v1_
(
v1
)
{}
template
<
typename
T
>
operator
ParamGenerator
<
T
>
()
const
{
return
ValuesIn
(
&
v1_
,
&
v1_
+
1
);
}
operator
ParamGenerator
<
T
>
()
const
{
const
T
array
[]
=
{
static_cast
<
T
>
(
v1_
)};
return
ValuesIn
(
array
);
}
private
:
// No implementation - assignment is unsupported.
...
...
include/gtest/internal/gtest-param-util-generated.h.pump
View file @
9e38d77f
...
...
@@ -72,29 +72,14 @@ internal::ParamGenerator<typename Container::value_type> ValuesIn(
namespace
internal
{
// Used in the Values() function to provide polymorphic capabilities.
template
<
typename
T1
>
class
ValueArray1
{
public
:
explicit
ValueArray1
(
T1
v1
)
:
v1_
(
v1
)
{}
template
<
typename
T
>
operator
ParamGenerator
<
T
>
()
const
{
return
ValuesIn
(
&
v1_
,
&
v1_
+
1
);
}
private
:
// No implementation - assignment is unsupported.
void
operator
=
(
const
ValueArray1
&
other
);
const
T1
v1_
;
};
$
range
i
2.
.
n
$
range
i
1.
.
n
$
for
i
[[
$
range
j
1.
.
i
template
<
$
for
j
,
[[
typename
T
$
j
]]
>
class
ValueArray
$
i
{
public
:
ValueArray
$
i
(
$
for
j
,
[[
T
$
j
v
$
j
]])
:
$
for
j
,
[[
v
$
(
j
)
_
(
v
$
j
)]]
{}
$
if
i
==
1
[[
explicit
]]
ValueArray
$
i
(
$
for
j
,
[[
T
$
j
v
$
j
]])
:
$
for
j
,
[[
v
$
(
j
)
_
(
v
$
j
)]]
{}
template
<
typename
T
>
operator
ParamGenerator
<
T
>
()
const
{
...
...
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