Types
在命名空间中引入了std::string
添加两个内联函数implicit_cast和down_cast
实现了memZero
实现
inline void memZero(void *p, size_t n) {
memset(p, 0, n);
}
template<typename To, typename From>
inline To implicit_cast(From const& f) {
return f;
}
template<typename To, typename From>
inline To down_cast(From* f) {
if(false) {
implicit_cast<From*, To>(0);
}
assert(f == NULL || dynamic_cast<To>(f) != NULL);
return static_cast<To>(f);
}