Opened 13 years ago
Closed 13 years ago
#3003 closed Bugs (fixed)
mem_fn does not work with CComPtr<T> in debug mode
Reported by: | Owned by: | Peter Dimov | |
---|---|---|---|
Milestone: | To Be Determined | Component: | bind |
Version: | Boost 1.38.0 | Severity: | Problem |
Keywords: | Cc: | roman.perepelitsa@… |
Description
Short description: boost::mem_fn does not work with CComPtr<T> in debug mode, because it takes the address of CComPtr<T>, which asserts.
See the thread on boost-users in which the problem was discussed: http://groups.google.com/group/boost-list/browse_thread/thread/e74efb5329e47e4e/83663a064e8838cc#83663a064e8838cc.
To reproduce the problem without CComPtr:
#include <cstdlib> #include <boost/bind.hpp>
struct foo {
void bar() {}
} f;
struct ptr {
void* operator&() { std::abort(); }
};
foo* get_pointer(const ptr& p) { return &f; }
int main() {
boost::bind(&foo::bar, ptr())();
}
I attached a diff against trunk that fixes the problem in a backward compatible way.
Attachments (1)
Change History (8)
by , 13 years ago
Attachment: | mem_fn_template.diff added |
---|
comment:1 by , 13 years ago
Cc: | added |
---|---|
Owner: | changed from | to
comment:2 by , 13 years ago
Owner: | changed from | to
---|
comment:3 by , 13 years ago
Milestone: | Boost 1.39.0 → To Be Determined |
---|
comment:4 by , 13 years ago
comment:5 by , 13 years ago
Status: | new → assigned |
---|
I initially assigned this to pdimov, but didn't receive any feedback in 6 months. Is it because someone else currently maintains bind?
Steven, could you reassign to the appropriate person?