TinySTL icon indicating copy to clipboard operation
TinySTL copied to clipboard

关于Allocator中destroy()函数以及Construct.h中destroy()函数的疑问

Open TJUSsr opened this issue 6 years ago • 0 comments

Allocator中destroy()函数没有对数据类型做萃取,全都调用了析构函数进行了析构,是不是需要结合Construct.h中destroy()函数对数据类型进行萃取之后再destroy().

还有一个问题就是Construct.h中destroy()函数直接 template <class ForwardIt> inline void destroy(ForwardIt first,ForwardIt last){ typedef typename _type_traits<ForwardIt>::is_POD_type is_POD_type; _destroy(first,last,is_POD_type()); }这样写是不是有点问题,是不是需要先萃取ForwardIt的value_type再_type_traits<>

一点小小的疑问

TJUSsr avatar May 08 '18 16:05 TJUSsr