stl_construct.h主要讲解了对象的构造与析构。
在其中destroy()函数,它有两个版本。通过判断对象的析构函数是否是trivial的,如果是就不调用析构函数,否则才会调用析构函数。
trivial表示无用的意思,在C++中判断一个对象的析构函数是否为no-trivial有如下方法:
The rule is very straight-forward: Does your class have an explicit destructor?
If yes, you're non-trivial.
If no, check each non-static member object; if any if them are non-trivial, then you're non-trivial.