Thursday, December 2, 2010

Using empty() instead of (size() == 0)

It is better to call empty() rather than compare size() to 0 on an STL containter. empty() has a low time complexity guarantee.

No comments:

Post a Comment