Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / smart_ptr / doc / smart_ptr / make_unique.adoc
index feb569c..a260131 100644 (file)
@@ -40,23 +40,23 @@ feature with `std::make_unique`.
 [subs=+quotes]
 ```
 namespace boost {
-  `// only if T is not an array type`
+  `// T is not an array`
   template<class T, class... Args>
     std::unique_ptr<T> make_unique(Args&&... args);
 
-  `// only if T is not an array type`
+  `// T is not an array`
   template<class T>
-    std::unique_ptr<T> make_unique(remove_reference_t<T>&& v);
+    std::unique_ptr<T> make_unique(type_identity_t<T>&& v);
 
-  `// only if T is an array type of the form U[]`
+  `// T is an array of unknown bounds`
   template<class T>
     std::unique_ptr<T> make_unique(std::size_t n);
 
-  `// only if T is not an array type`
+  `// T is not an array`
   template<class T>
     std::unique_ptr<T> make_unique_noinit();
 
-  `// only if T is an array type of the form U[]`
+  `// T is an array of unknown bounds`
   template<class T>
     std::unique_ptr<T> make_unique_noinit(std::size_t n);
 }
@@ -71,20 +71,18 @@ template<class T, class... Args>
 [none]
 * {blank}
 +
-Remarks:: These overloads shall only participate in overload resolution when
-`T` is not an array type.
+Constraints:: `T` is not an array.
 Returns:: `std::unique_ptr<T>(new T(std::forward<Args>(args)\...)`.
 Example:: `auto p = make_unique<int>();`
 
 ```
 template<class T>
-  std::unique_ptr<T> make_unique(remove_reference_t<T>&& v);
+  std::unique_ptr<T> make_unique(type_identity_t<T>&& v);
 ```
 [none]
 * {blank}
 +
-Remarks:: These overloads shall only participate in overload resolution when
-`T` is not an array type.
+Constraints:: `T` is not an array.
 Returns:: `std::unique_ptr<T>(new T(std::move(v))`.
 Example:: `auto p = make_unique<std::vector<int> >({1, 2});`
 
@@ -95,9 +93,8 @@ template<class T>
 [none]
 * {blank}
 +
-Remarks:: These overloads shall only participate in overload resolution when
-`T` is an array type of the form `U[]`.
-Returns:: `std::unique_ptr<U[]>(new U[n]())`.
+Constraints:: `T` is an array of unknown bounds.
+Returns:: `std::unique_ptr<T>(new remove_extent_t<T>[n]())`.
 Example:: `auto p = make_unique<double[]>(1024);`
 
 ```
@@ -107,8 +104,7 @@ template<class T>
 [none]
 * {blank}
 +
-Remarks:: These overloads shall only participate in overload resolution when
-`T` is not an array type.
+Constraints:: `T` is not an array.
 Returns:: `std::unique_ptr<T>(new T)`.
 Example:: `auto p = make_unique_noinit<double[1024]>();`
 
@@ -119,7 +115,6 @@ template<class T>
 [none]
 * {blank}
 +
-Remarks:: These overloads shall only participate in overload resolution when
-`T` is an array type of the form `U[]`.
-Returns:: `std::unique_ptr<U[]>(new U[n])`.
+Constraints:: `T` is an array of unknown bounds.
+Returns:: `std::unique_ptr<T>(new remove_extent_t<T>[n])`.
 Example:: `auto p = make_unique_noinit<double[]>(1024);`