Googletest export

Rewrite ReturnNew action without using pump.

PiperOrigin-RevId: 308219616
This commit is contained in:
Abseil Team
2020-04-24 05:17:47 -04:00
committed by Gennadiy Rozental
parent d7ca9af004
commit 955552518b
6 changed files with 104 additions and 175 deletions

View File

@@ -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