smartptr: support const pointer dynamic cast

 const smartptr is used quite often, and dynamic_cast_ptr
 would failed on const objects. this fix set the function
 to const to make all possible pointer pass through.
1 file changed