| 151 | |
| 152 | template <class NewType> |
| 153 | DUChainPointer<NewType> dynamicCast() const |
| 154 | { |
| 155 | if (d && dynamic_cast<NewType*>(d->base())) //When the reference to the pointer is constant that doesn't mean that the pointed object needs to be constant |
| 156 | return DUChainPointer<NewType>(static_cast<NewType*>(d->base())); |
| 157 | else |
| 158 | return DUChainPointer<NewType>(); |
| 159 | } |
| 160 | |
| 161 | Type* data() const |
| 162 | { |