Cast raw pointer of array to unique_ptr
问题 I am working against a blackbox framework (cdg), which fills an array of uint32_t with values. The call looks like that: std::size_t dataCount = 100; uint32_t* data = new uint32_t[dataCount]; cdg.generate(data); Unfortunately, the framework doesn't use templates, so I have to pass in a uint32_t* . To get rid of the raw pointer I want to "wrap" it into a std::unique_ptr<uint32_t> . Thus it is an array I think I have to use a std::unique_ptr<uint32_t[]> . Is there a way to convert the raw