Opened 10 years ago
Closed 10 years ago
#7722 closed Bugs (fixed)
smart_ptr includes <new> even if not needed
| Reported by: | Owned by: | Peter Dimov | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | smart_ptr |
| Version: | Boost Development Trunk | Severity: | Problem |
| Keywords: | Cc: |
Description
I'm using a subset of Boost in a project compiled with armcc and custom libraries. It's for an embedded system. As expected the compiler and/or libraries are broken, but I was able to workaround almost all problems with the macros BOOST_NO_RTTI, BOOST_EXCEPTION_DISABLE etc.
However, the compiler still complains about the missing header <new> (not included in the library), because it's included by smart_ptr/detail/shared_count.hpp to have std::bad_alloc declared.
But since std::bad_alloc is used only when BOOST_NO_EXCEPTIONS is defined (I'm not defining it) it's not always really needed. I attached a patch which alleviates the problem for those of us dealing with broken compilers and brings (I believe) no side effect for the rest of the community.
Attachments (1)
Change History (4)
by , 10 years ago
| Attachment: | shared_count.patch added |
|---|
comment:1 by , 10 years ago
comment:2 by , 10 years ago
It seems to me that you could also create an empty <new> header instead of fixing all includes of it, but the patch doesn't hurt, so I applied it.
comment:3 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |

(In [81488]) Apply patch from #7722. Refs #7722.