mirror of
https://github.com/google/googletest.git
synced 2025-11-30 16:17:28 -05:00
Googletest export
Rewrite ReturnNew action without using pump. PiperOrigin-RevId: 308219616
This commit is contained in:
committed by
Gennadiy Rozental
parent
d7ca9af004
commit
955552518b
@@ -344,24 +344,6 @@ ACTION_TEMPLATE(InvokeArgument,
|
||||
|
||||
]]
|
||||
|
||||
// Various overloads for ReturnNew<T>().
|
||||
//
|
||||
// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
|
||||
// instance of type T, constructed on the heap with constructor arguments
|
||||
// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
|
||||
$range i 0..n
|
||||
$for i [[
|
||||
$range j 0..i-1
|
||||
$var ps = [[$for j, [[p$j]]]]
|
||||
|
||||
ACTION_TEMPLATE(ReturnNew,
|
||||
HAS_1_TEMPLATE_PARAMS(typename, T),
|
||||
AND_$i[[]]_VALUE_PARAMS($ps)) {
|
||||
return new T($ps);
|
||||
}
|
||||
|
||||
]]
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user