Normal view MARC view ISBD view

Effective STL : 50 specific ways to improve your use of the standard template library / Scott Meyers.

By: Meyers, Scott (Scott Douglas).
Series: Addison-Wesley professional computing series. Publisher: Boston, Mass. : Addison-Wesley, c2001Description: xviii, 260 p. ; 24 cm.ISBN: 0201749629.Subject(s): Standard template library | C++ (Computer program language)DDC classification: 005.133
Contents:
Item 26. Prefer iterator to constiterator, reverseiterator, and constreverseiterator. Item 27. Use distance and advance to convert a container's constiterators to iterators. Item 28. Understand how to use a reverseiterator's base iterator. Item 29. Consider istreambufiterators for character-by-character input. - Ch. 5. Algorithms. Item 30. Make sure destination ranges are big enough. Item 31. Know your sorting options. Item 32. Follow remove-like algorithms by erase if you really want to remove something. Item 33. Be wary of remove-like algorithms on containers of pointers. Item 34. Note which algorithms expect sorted ranges. Item 35. Implement simple case-insensitive string comparisons via mismatch or lexicographicalcompare. Item 36. Understand the proper implementation of copyif. Item 37. Use accumulate or foreach to summarize ranges. - Ch. 6 Functions, Functor Classes, Functions, etc. Item 38. Design functor classes for pass-by-value.
Preface. - Acknowledgments. - Introduction. - Ch. 1 Containers. - Item 1. Choose your containers with care. Item 2. Beware the illusion of container-independent code. Item 3. Make copying cheap and correct for objects in containers. Item 4. Call empty instead of checking size() against zero. - Item 5. Prefer range member functions to their single-element counterparts. Item 6. Be alert for C++'s most vexing parse. Item 7. When using containers of newed pointers, remember to delete the pointers before the container is destroyed. Item 8. Never create containers of autoptrs. Item 9. Choose carefully among erasing options. Item 10. Be aware of allocator conventions and restrictions. Item 11. Understand the legitimate uses of custom allocators. Item 12. Have realistic expectations about the thread safety of STL containers. - Ch. 2 vector and string. Item 13. Prefer vector and string to dynamically allocated arrays. Item 14. Use reserve to avoid unnecessary reallocations. Item 15. Be aware of variations in string implementations. Item 16. Know how to pass vector and string data to legacy APIs. Item 17. Use "the swap trick" to trim excess capacity. Item 18. Avoid using vector. - Ch. 3. Associative Containers. Item 19. Understand the difference between equality and equivalence. Item 20. Specify comparison types for associative containers of pointers. Item 21. Always have comparison functions return false for equal values. Item 22. Avoid in-place key modification in set and multiset. Item 23. Consider replacing associative containers with sorted vectors. Item 24. Choose carefully between map::operator[ ] and map::insert when efficiency is important. Item 25. Familiarize yourself with the nonstandard hashed containers. - Ch. 4 Iterators.
Summary: In this book, best-selling author Scott Meyers reveals the critical rules of thumb employed by the experts to get the most out of the [Standard Template] library. Highlights of Effective STL include : Advice on choosing among standard STL containers (like vector and list ), nonstandard STL containers (like hash_set and hash_map), and non-STL containers (like bitset) ; techniques to maximize the efficiency of the STL and the programmes that use it ; insights into the behaviour of iterators, function objects, and allocators, including things you should not do ; guidance for the proper use of algorithms and member functions whose names are the same (e.g. find), but whose actions differ in subtle (but important) ways ; discussions of potential portability problems, including straighforward ways to avoid them. - Back cover
Item type Current location Shelf location Call number Copy number Status Notes Date due Barcode
Main Collection Taylor's Library-TU

Floor 3, Shelf 1 , Side 1, TierNo 2, BayNo 1

005.133 MEY (Browse shelf) 1 Available SOCIT,15008,03,GR 5000169573
Main Collection Taylor's Library-TU

Floor 3, Shelf 1 , Side 1, TierNo 2, BayNo 1

005.133 MEY (Browse shelf) 1 Available SOCIT,15008,03,GR 5000039675

Item 26. Prefer iterator to constiterator, reverseiterator, and constreverseiterator. Item 27. Use distance and advance to convert a container's constiterators to iterators. Item 28. Understand how to use a reverseiterator's base iterator. Item 29. Consider istreambufiterators for character-by-character input. - Ch. 5. Algorithms. Item 30. Make sure destination ranges are big enough. Item 31. Know your sorting options. Item 32. Follow remove-like algorithms by erase if you really want to remove something. Item 33. Be wary of remove-like algorithms on containers of pointers. Item 34. Note which algorithms expect sorted ranges. Item 35. Implement simple case-insensitive string comparisons via mismatch or lexicographicalcompare. Item 36. Understand the proper implementation of copyif. Item 37. Use accumulate or foreach to summarize ranges. - Ch. 6 Functions, Functor Classes, Functions, etc. Item 38. Design functor classes for pass-by-value.

Preface. - Acknowledgments. - Introduction. - Ch. 1 Containers. - Item 1. Choose your containers with care. Item 2. Beware the illusion of container-independent code. Item 3. Make copying cheap and correct for objects in containers. Item 4. Call empty instead of checking size() against zero. - Item 5. Prefer range member functions to their single-element counterparts. Item 6. Be alert for C++'s most vexing parse. Item 7. When using containers of newed pointers, remember to delete the pointers before the container is destroyed. Item 8. Never create containers of autoptrs. Item 9. Choose carefully among erasing options. Item 10. Be aware of allocator conventions and restrictions. Item 11. Understand the legitimate uses of custom allocators. Item 12. Have realistic expectations about the thread safety of STL containers. - Ch. 2 vector and string. Item 13. Prefer vector and string to dynamically allocated arrays. Item 14. Use reserve to avoid unnecessary reallocations. Item 15. Be aware of variations in string implementations. Item 16. Know how to pass vector and string data to legacy APIs. Item 17. Use "the swap trick" to trim excess capacity. Item 18. Avoid using vector. - Ch. 3. Associative Containers. Item 19. Understand the difference between equality and equivalence. Item 20. Specify comparison types for associative containers of pointers. Item 21. Always have comparison functions return false for equal values. Item 22. Avoid in-place key modification in set and multiset. Item 23. Consider replacing associative containers with sorted vectors. Item 24. Choose carefully between map::operator[ ] and map::insert when efficiency is important. Item 25. Familiarize yourself with the nonstandard hashed containers. - Ch. 4 Iterators.

In this book, best-selling author Scott Meyers reveals the critical rules of thumb employed by the experts to get the most out of the [Standard Template] library. Highlights of Effective STL include : Advice on choosing among standard STL containers (like vector and list ), nonstandard STL containers (like hash_set and hash_map), and non-STL containers (like bitset) ; techniques to maximize the efficiency of the STL and the programmes that use it ; insights into the behaviour of iterators, function objects, and allocators, including things you should not do ; guidance for the proper use of algorithms and member functions whose names are the same (e.g. find), but whose actions differ in subtle (but important) ways ; discussions of potential portability problems, including straighforward ways to avoid them. - Back cover