Item 4: Call empty instead of checking size() against zero

 empty  is  a constant-time operation for all standard containers, but for some list implementations, size takes linear time.
posted @ 2009-08-23 22:06  Aldrich  阅读(179)  评论(0)    收藏  举报