阅读背景:

当T是原始类型时,std:::向量::clear()的复杂性是什么?

来源:互联网 

I understand that the complexity of the clear() operation is linear in the size of the container, because the destructors must be called. But what about primitive types (and POD)? It seems the best thing to do would be to set the vector size to 0, so that the complexity is constant.I understand that the complexity of the clear()




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: