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);
Returns: unique_ptr<T>(new T(std​::​forward<Args>(args).).
template<class T> constexpr unique_ptr<T> make_unique(size_t n);
Returns: unique_ptr<T>(new remove_extent_t<T>[n]().
template<class T, class. Args> unspecified make_unique(Args&&.) = delete;
Constraints: T is an array of known bound.
template<class T> constexpr unique_ptr<T> make_unique_for_overwrite();
Returns: unique_ptr<T>(new T).
template<class T> constexpr unique_ptr<T> make_unique_for_overwrite(size_t n);
Returns: unique_ptr<T>(new remove_extent_t<T>[n]).
template<class T, class. Args> unspecified make_unique_for_overwrite(Args&&.) = delete;
Constraints: T is an array of known bound.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant