Files
2025-10-25 03:02:53 +03:00

2.7 KiB
Raw Permalink Blame History

[unique.ptr.create]

20 Memory management library [mem]

20.3 Smart pointers [smartptr]

20.3.1 Unique-ownership pointers [unique.ptr]

20.3.1.5 Creation [unique.ptr.create]

🔗

template<class T, class... Args> constexpr unique_ptr<T> make_unique(Args&&... args);

1

#

Constraints: T is not an array type.

2

#

Returns: unique_ptr(new T(std::forward(args)...)).

🔗

template<class T> constexpr unique_ptr<T> make_unique(size_t n);

3

#

Constraints: T is an array of unknown bound.

4

#

Returns: unique_ptr(new remove_extent_tn).

🔗

template<class T, class... Args> unspecified make_unique(Args&&...) = delete;

5

#

Constraints: T is an array of known bound.

🔗

template<class T> constexpr unique_ptr<T> make_unique_for_overwrite();

6

#

Constraints: T is not an array type.

7

#

Returns: unique_ptr(new T).

🔗

template<class T> constexpr unique_ptr<T> make_unique_for_overwrite(size_t n);

8

#

Constraints: T is an array of unknown bound.

9

#

Returns: unique_ptr(new remove_extent_t[n]).

🔗

template<class T, class... Args> unspecified make_unique_for_overwrite(Args&&...) = delete;

10

#

Constraints: T is an array of known bound.