#10751 closed Bugs (worksforme)
exception_detail::set_info should use make_shared
Reported by: | Owned by: | Emil Dotchevski | |
---|---|---|---|
Milestone: | To Be Determined | Component: | exception |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
info.hpp:170
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
should be
shared_ptr<error_info_tag_t> p = make_shared<error_info_tag_t>(v);
Change History (3)
comment:1 by , 8 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 by , 8 years ago
Sorry, but I think it will be less likely to have bad_alloc with make_shared.
comment:3 by , 8 years ago
This isn't necessarily true: the free space may by fragmented and it is possible that two smaller allocations succeed while the single bigger allocation from make_shared fails.
Either way the program should be exception-safe in case adding error info throws.
Note:
See TracTickets
for help on using tickets.
This doesn't seem like a bug to me.