|
Bugzilla – Full Text Bug Listing |
| Summary: | Callbacks cannot be created for member methods and Ptr<T> object instances | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Mathieu Lacage <mathieu.lacage> |
| Component: | core | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | blocker | ||
| Priority: | P1 | ||
| Version: | pre-release | ||
| Hardware: | PC | ||
| OS: | Linux | ||
the following code will not compile: Ptr<MyObject> p; MakeCallback (&MyObject::MyMethod, p); The solution probably would require us to define a CallbackTraits<T> template class and specialize it for the Ptr class: template <typename T> struct CallbackTraits { typedef T * PointerType; }; template <> struct CallbackTraits<Ptr> { typedef Ptr<T> PointerType }; and use CallbackTraits<T>::PointerType in callback.h wherever we use T *.