Bifalgorithm post
So let's say I have this int pointer and then I do like std unique pointer int pointer one pass and P and then std unique pointer int pointer two and I pass and P. What sort of issues do you see here, if any? Right. Yeah. And, um, unique pointer. Yeah. So you, um, the recommended practice is basically to use make unique, which I believe is introduced in C++ 14. Yeah. Um, so that way, that way, basically, like you would, um, allocate the memory inside its own constructor in a safe fashion.
So let's say I have this int pointer and then I do like std unique pointer int pointer one pass and P and then std unique pointer int pointer two and I pass an…
Ideas in this flowchart
- Unique Pointer Usage
- Issue Identification
- Multiple Unique Pointers to Same Resource
- Recommended Practice
- Use make_unique
- Introduced in C++14
- Safe Memory Allocation