skip to content
Effective STL : 50 specific ways to improve your use of the standard template library Preview this item
ClosePreview this item

Effective STL : 50 specific ways to improve your use of the standard template library

Author: Scott Douglas Meyers
Publisher: Boston [u.a.] : Addison-Wesley, 2001.
Series: Addison-Wesley professional computing series.
Edition/Format:   Print book : EnglishView all editions and formats

Providing information on C++'s Standard Template Library, this book shows you how to use it. It includes: advice on choosing among standard STL containers, nonstandard STL containers, and non-STL  Read more...


(not yet rated) 0 with reviews - Be the first.

More like this


Find a copy in the library

&AllPage.SpinnerRetrieving; Finding libraries that hold this item...


Document Type: Book
All Authors / Contributors: Scott Douglas Meyers
ISBN: 0201749629 9780201749625
OCLC Number: 248421339
Description: XVIII, 260 S ; 24 cm.
Contents: Preface xiAcknowledgments xvIntroduction 1Chapter 1: Containers 11Item 1: Choose your containers with care. 11Item 2: Beware the illusion of container-independent code. 15Item 3: Make copying cheap and correct for objects in containers. 20Item 4: Call empty instead of checking size() against zero. 23Item 5: Prefer range member functions to their single-element counterparts. 24Item 6: Be alert for C++'s most vexing parse. 33Item 7: When using containers of newed pointers, remember to delete the pointers before the container is destroyed. 36Item 8: Never create containers of auto_ptrs. 40Item 9: Choose carefully among erasing options. 43Item 10: Be aware of allocator conventions and restrictions. 48Item 11: Understand the legitimate uses of custom allocators. 54Item 12: Have realistic expectations about the thread safety of STL containers. 58Chapter 2: vector and string 63Item 13: Prefer vector and string to dynamically allocated arrays. 63Item 14: Use reserve to avoid unnecessary reallocations. 66Item 15: Be aware of variations in string implementations. 68Item 16: Know how to pass vector and string data to legacy APIs. 74Item 17: Use "the swap trick" to trim excess capacity. 77Item 18: Avoid using vector. 79Chapter 3: Associative Containers 83Item 19: Understand the difference between equality and equivalence. 83Item 20: Specify comparison types for associative containers of pointers. 88Item 21: Always have comparison functions return false for equal values. 92Item 22: Avoid in-place key modification in set and multiset. 95Item 23: Consider replacing associative containers with sorted vectors. 100Item 24: Choose carefully between map::operator[] and map::insert when efficiency is important. 106Item 25: Familiarize yourself with the nonstandard hashed containers. 111Chapter 4: Iterators 116Item 26: Prefer iterator to const_iterator, reverse_iterator, and const_reverse_iterator. 116Item 27: Use distance and advance to convert const_iterators to iterators. 120Item 28: Understand how to use a reverse_iterator's base iterator. 123Item 29: Consider istreambuf_iterators for character by character input. 126Chapter 5: Algorithms 128Item 30: Make sure destination ranges are big enough. 129Item 31: Know your sorting options. 133Item 32: Follow remove-like algorithms by erase if you really want to remove something. 139Item 33: Be wary of remove-like algorithms on containers of pointers. 143Item 34: Note which algorithms expect sorted ranges. 146Item 35: Implement simple case-insensitive string comparisons via mismatch or lexicographical_compare. 150Item 36: Understand the proper implementation of copy_if. 154Item 37: Use accumulate or for_each to summarize ranges. 156Chapter 6: Functors, Functor Classes, Functions, etc. 162Item 38: Design functor classes for pass-by-value. 162Item 39: Make predicates pure functions. 166Item 40: Make functor classes adaptable. 169Item 41: Understand the reasons for ptr_fun, mem_fun, and mem_fun_ref. 173Item 42: Make sure less means operator<. 177Chapter 7: Programming with the STL 181Item 43: Prefer algorithm calls to hand-written loops. 181Item 44: Prefer member functions to algorithms with the same names. 190Item 45: Distinguish among count, find, binary_search, lower_bound, upper_bound, and equal_range. 192Item 46: Consider function objects instead of functions as algorithm parameters. 201Item 47: Avoid producing write-only code. 206Item 48: Always #include the proper headers. 209Item 49: Learn to decipher STL-related compiler diagnostics. 210Item 50: Familiarize yourself with STL-related web sites. 217Bibliography 225Appendix A: Locales and Case-Insensitive String Comparisons 229Appendix B: Remarks on Microsoft's STL Platforms 239Index 245
Series Title: Addison-Wesley professional computing series.
Responsibility: Scott Meyers.


User-contributed reviews
Retrieving GoodReads reviews...
Retrieving DOGObooks reviews...


Be the first.
Confirm this request

You may have already requested this item. Please select Ok if you would like to proceed with this request anyway.

Linked Data

Primary Entity

<> # Effective STL : 50 specific ways to improve your use of the standard template library
    a schema:Book, schema:CreativeWork ;
   library:oclcnum "248421339" ;
   library:placeOfPublication <> ;
   library:placeOfPublication <> ; # Boston u.a.
   schema:about <> ; # C++ (Computer program language)
   schema:about <> ; # STL
   schema:about <> ; # STL ; SWD-ID: 44113262
   schema:about <> ; # Standard template library
   schema:about <> ; # Standard template library--Computer file
   schema:about <> ;
   schema:about <> ; # C++ ; SWD-ID: 41939098
   schema:bookFormat bgn:PrintBook ;
   schema:creator <> ; # Scott Douglas Meyers
   schema:datePublished "2001" ;
   schema:exampleOfWork <> ;
   schema:inLanguage "en" ;
   schema:isPartOf <> ; # Addison-Wesley professional computing series.
   schema:name "Effective STL : 50 specific ways to improve your use of the standard template library" ;
   schema:productID "248421339" ;
   schema:publication <> ;
   schema:publisher <> ; # Addison-Wesley
   schema:workExample <> ;
   wdrs:describedby <> ;

Related Entities

<> # Addison-Wesley
    a bgn:Agent ;
   schema:name "Addison-Wesley" ;

<> # Addison-Wesley professional computing series.
    a bgn:PublicationSeries ;
   schema:hasPart <> ; # Effective STL : 50 specific ways to improve your use of the standard template library
   schema:name "Addison-Wesley professional computing series." ;
   schema:name "Addison-Wesley professional computing series" ;

<> # C++ ; SWD-ID: 41939098
    a schema:Intangible ;
   schema:name "C++ ; SWD-ID: 41939098" ;

<> # Standard template library
    a schema:Intangible ;
   schema:name "Standard template library" ;

<> # Standard template library--Computer file
    a schema:Intangible ;
   schema:name "Standard template library--Computer file" ;
   schema:name "Standard Template Library--Computer file" ;

<> # STL ; SWD-ID: 44113262
    a schema:Intangible ;
   schema:name "STL ; SWD-ID: 44113262" ;

<> # C++ (Computer program language)
    a schema:Intangible ;
   schema:name "C++ (Computer program language)" ;

<> # Scott Douglas Meyers
    a schema:Person ;
   schema:familyName "Meyers" ;
   schema:givenName "Scott Douglas" ;
   schema:name "Scott Douglas Meyers" ;

    a schema:ProductModel ;
   schema:isbn "0201749629" ;
   schema:isbn "9780201749625" ;

    a genont:InformationResource, genont:ContentTypeGenericResource ;
   schema:about <> ; # Effective STL : 50 specific ways to improve your use of the standard template library
   schema:dateModified "2017-09-02" ;
   void:inDataset <> ;

Content-negotiable representations

Close Window

Please sign in to WorldCat 

Don't have an account? You can easily create a free account.