View Single Post
  #1  
Old 09-12-2011, 08:18 AM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 269
Default

Quote:
In case anyone cares about the longer explanation, the empty() function is guaranteed to be constant time where the size() function is not. In practice, for most containers including deque they are both constant time and empty() just returns size() == 0, but there are some implementations where that isn't true. It's talked about in Effective STL #4.
That's awesome actually, thanks.

http://www.uml.org.cn/c++/pdf/EffectiveSTL.pdf
Reply With Quote