Timeline for Implementation of unique_ptr and make_unique for aligned memory
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 16, 2015 at 15:45 | vote | accept | Simon | ||
May 15, 2015 at 18:05 | comment | added | Quuxplusone |
@simon re 3rd comment: You asked how unique_ptr<T[]> for non-POD T should figure out how many objects to destroy. The answer is, you'll have to keep track of that in a member variable or else rely on _msize to guess how many you have. @simon re 2nd comment: Sure, I'd be reasonably happy with consistent use of std::unique_ptr and aligned::unique_ptr (and no use of unqualified unique_ptr ... except that some uses (such as in constructor declarations) have to be unqualified; that might be a bit confusing. It's still strictly better than your original all-unqualified approach, though!
|
|
May 14, 2015 at 20:01 | comment | added | Simon |
Regarding the suggestion in your 2nd comment: You give details::uniq_ptr as an example. Do you see any reason why I should not just spell out the type including the namespace name, i.e., write aligned::unique_ptr everywhere in the header?
|
|
May 14, 2015 at 19:49 | comment | added | Simon |
I agree with your comments 1,2, and 4. I do not quite understand what you mean in your 3rd comment though. posix_memalign stores the size somehow, so free will do its job properly.
|
|
May 14, 2015 at 18:24 | history | answered | Quuxplusone | CC BY-SA 3.0 |