Use type traits (std::has_trivial_destructor) to avoid performing useless operations in purge() function.