std::vector::empty
Returns whether the vector is empty (i.e. whether its size is 0).
测试vector的是否为空(size为0)
This function does not modify the container in any way. To clear the content of a vector, see vector::clear.
该函数不会以任何的方式修改容器,如果要清空vector的内容,可以使用clear.
Parameters
none
Return Value
true if the container size is 0, false otherwise.
返回值为true或者false
Example
|
|
The example initializes the content of the vector to a sequence of numbers (form 1 to 10). It then pops the elements one by one until it is empty and calculates their sum.
这个例子先将vector初始化为1–10,然后每次删除最后一个元素并将其加到sum中直到数组为空。
Output:
total: 55
|
Complexity
Constant.
Iterator validity
No changes.
Data races
The container is accessed.
容器将被访问。
No contained elements are accessed: concurrently accessing or modifying them is safe.
容器内的元素不会被访问,同时修改以及访问他们都是安全的。
Exception safety
No-throw guarantee: this member function never throws exceptions.
该成员方法不会抛出异常。
//翻译的不好的地方请多多指导,可以在下面留言或者点击左上方邮件地址给我发邮件,指出我的错误以及不足,以便我修改,更好的分享给大家,谢谢。
转载请注明出处:http://blog.csdn.net/qq844352155
2014-8-17
于GDUT