[CXX-1162] Use stdx::make_unique instead of bare calls to 'new' when initializing std::unique_ptr variables, where possible Created: 12/Dec/16 Updated: 11/Aug/17 Resolved: 07/Jun/17 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | Implementation |
| Affects Version/s: | None |
| Fix Version/s: | 3.2.0-rc0 |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Backlog - CXX Driver Team | Assignee: | Patrick Freed |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Using stdx::make_unique increases exception safety in some circumstances. See https://herbsutter.com/gotw/_102/ for reference. |
| Comments |
| Comment by Githook User [ 07/Jun/17 ] |
|
Author: {u'username': u'patrickfreed', u'name': u'Patrick Freed', u'email': u'fridpatrick@gmail.com'}Message: This commit does not change some instances due to their need for a supplied destructor (make_unique does not allow for them). |
| Comment by J Rassi [ 12/Dec/16 ] |
|
Right, thanks for the reminder. Updated summary to add "where possible". |
| Comment by Andrew Morrow (Inactive) [ 12/Dec/16 ] |
|
Note that there may be cases where you can't, because the constructor of the thing you want to make_unique for is private, and them std[x]::make_unique can't call it. |