Opened 12 years ago
Closed 12 years ago
#5178 closed Bugs (fixed)
boost::exception uses invalid C++ code
Reported by: | Chris Jefferson | Owned by: | Emil Dotchevski |
---|---|---|---|
Milestone: | To Be Determined | Component: | exception |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
boost::exception uses a
std::map<type_info_, shared_ptr<error_info_base> > in error_info_container_impl. This map is copied in clone(). However, type_info_ contains a member which is a reference, so it is not copyable.
The standard says that you can only copy a std::map<T,U> if both T and U are copyable. Some standard libraries don't make use of this requirement, but libc++ does.
The easiest fix to this would be to make type_info_ take it's reference member instead by pointer, and make it copyable.
Before I prepare a full patch, I wondered if anyone had any comments, as this is a fairly big change to boost::exception
Attachments (1)
Change History (4)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
You are right, that is much simpler, and I missed it. Thanks.
The attached patch does exactly this, and fixes all but one bug in libc++ boost::exception (which is a different problem). gcc darwin still passes all tests.
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Actually, the solution is simple:
The standard only requires the template arguments to be CopyAssignable for assignment, not for copy construction.