|
Bugzilla – Full Text Bug Listing |
| Summary: | feature request: templated DynamicCast | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Tom Henderson <tomh> |
| Component: | core | Assignee: | Mathieu Lacage <mathieu.lacage> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | gjcarneiro, ns-bugs |
| Priority: | P3 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
+1 from me :) +1 changeset b03ea30335a3 |
Quoting Gustavo from a post from about a month ago: "Although dynamic_cast<CsmaNetDevice*> (PeekPointer (dev)) is a bit more verbose. Ideally I think it would make a lot of sense to have a smart-pointer based dynamic cast variant, something like: static inline Ptr<T2> DynamicCast<T2> (Ptr<T1> ptr) { return Ptr<T2> (dynamic_cast<T2*> (PeekPointer (ptr))); } Unfortunately the idea got no traction, at the time." I'd like to suggest we consider adding this.