构造机制
template <class T1, class T2>
inline void construct(T1 *p, T2 value)
{
new (p) T1(value);
}
template <class T>
inline void destory(T* p)
{
p->~T();
}
template <class T>
inline void destory(T beg, T end)
{
using is_POD_type = typename _type_traits<T>::is_POD_type;
_destory_aux(beg, end, is_POD_type());
}
template <class T>
inline void _destory_aux(T beg, T end, _false_type)
{
for (; beg != end; ++beg)
{
destory(&*beg);
}
}
template <class T>
inline void _destory_aux(T, T, _true_type){}
inline void destory(char* ,char *) {}
inline void destory(wchar_t*, wchar_t*){}