Bug 1037461. mfbt: Add a MakeUnique variant that takes 5 arguments.
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 11 Jul 2014 11:01:47 -0400
changeset 193603 5373a38e3306a385e75e3500c0aadebc72059d5c
parent 193602 9396c2c95b0036b703e609e2f1578b8c6a0f7a91
child 193604 8159de6c90c59ba367bf9a3d1ef1a7c92bf9bc5b
push id27123
push userryanvm@gmail.com
push dateFri, 11 Jul 2014 20:35:05 +0000
treeherdermozilla-central@84bd8d9f4256 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1037461
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1037461. mfbt: Add a MakeUnique variant that takes 5 arguments.
mfbt/UniquePtr.h
--- a/mfbt/UniquePtr.h
+++ b/mfbt/UniquePtr.h
@@ -629,16 +629,23 @@ MakeUnique(A1&& a1, A2&& a2, A3&& a3)
 
 template<typename T, typename A1, typename A2, typename A3, typename A4>
 typename detail::UniqueSelector<T>::SingleObject
 MakeUnique(A1&& a1, A2&& a2, A3&& a3, A4&& a4)
 {
   return UniquePtr<T>(new T(Forward<A1>(a1), Forward<A2>(a2), Forward<A3>(a3), Forward<A4>(a4)));
 }
 
+template<typename T, typename A1, typename A2, typename A3, typename A4, typename A5>
+typename detail::UniqueSelector<T>::SingleObject
+MakeUnique(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5)
+{
+  return UniquePtr<T>(new T(Forward<A1>(a1), Forward<A2>(a2), Forward<A3>(a3), Forward<A4>(a4), Forward<A5>(a5)));
+}
+
 template<typename T>
 typename detail::UniqueSelector<T>::UnknownBound
 MakeUnique(decltype(sizeof(int)) n)
 {
   typedef typename RemoveExtent<T>::Type ArrayType;
   return UniquePtr<T>(new ArrayType[n]());
 }