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 215521 5373a38e3306a385e75e3500c0aadebc72059d5c
parent 215520 9396c2c95b0036b703e609e2f1578b8c6a0f7a91
child 215522 8159de6c90c59ba367bf9a3d1ef1a7c92bf9bc5b
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [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]());
 }