Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Introduction > Efficiency Items

Efficiency Items

I considered including a chapter on efficiency in Effective STL, but I ultimately decided that the current organization was preferable. Still, a number of Items focus on minimizing space and runtime demands. For your performance-enhancing convenience, here is the table of contents for the virtual chapter on efficiency:

Item 4:Call empty instead of checking size() against zero.23
Item 5:Prefer range member functions to their single-element counterparts.24
Item 14:Use reserve to avoid unnecessary reallocations.66
Item 15:Be aware of variations in string implementations.68
Item 23:Consider replacing associative containers with sorted vectors.100
Item 24:Choose carefully between map::operator[] and map::insert when efficiency is important.106
Item 25:Familiarize yourself with the nonstandard hashed containers.111
Item 29:Consider istreambuf_iterators for character-by-character input.126
Item 31:Know your sorting options.133
Item 44:Prefer member functions to algorithms with the same names.190
Item 46:Consider function objects instead of functions as algorithm parameters.201



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial