789 safe c++

140 628 0
789 safe c++

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

... wondering whether the title of this book, Safe C++, presumes that the C++ programming language is somehow unsafe Good catch! That is indeed the presumption The C++ language allows programmers to make...www.it-ebooks.info Safe C++ Vladimir Kushnir Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo www.it-ebooks.info Safe C++ by Vladimir Kushnir Copyright © 2012 Vladimir... sense, the C++ language is inherently unsafe This book discusses some of the most common mistakes made by us, the programmers, in C++ code, and offers recipes for avoiding them The C++ community

Ngày đăng: 11/07/2018, 14:27

Mục lục

  • Table of Contents

  • Preface

    • Audience

    • How This Book Is Organized

    • Conventions Used in This Book

    • Naming Conventions

    • Using Code Examples

    • Safari® Books Online

    • How to Contact Us

    • Acknowledgments

  • Part I. A Bug-Hunting Strategy for C++

    • Chapter 1. Where Do C++ Bugs Come From?

    • Chapter 2. When to Catch a Bug

      • Why the Compiler Is Your Best Place to Catch Bugs

      • How to Catch Bugs in the Compiler

      • The Proper Way to Handle Types

    • Chapter 3. What to Do When We Encounter an Error at Runtime

  • Part II. Bug Hunting: One Bug at a Time

    • Chapter 4. Index Out of Bounds

      • Dynamic Arrays

      • Static Arrays

      • Multidimensional Arrays

    • Chapter 5. Pointer Arithmetic

    • Chapter 6. Invalid Pointers, References, and Iterators

    • Chapter 7. Uninitialized Variables

      • Initialized Numbers (int, double, etc.)

      • Uninitialized Boolean

    • Chapter 8. Memory Leaks

      • Reference Counting Pointers

      • Scoped Pointers

      • Enforcing Ownership with Smart Pointers

    • Chapter 9. Dereferencing NULL Pointers

    • Chapter 10. Copy Constructors and Assignment Operators

    • Chapter 11. Avoid Writing Code in Destructors

    • Chapter 12. How to Write Consistent Comparison Operators

    • Chapter 13. Errors When Using Standard C Libraries

  • Part III. The Joy of Bug Hunting: From Testing to Debugging to Production

    • Chapter 14. General Testing Principles

    • Chapter 15. Debug-On-Error Strategy

    • Chapter 16. Making Your Code Debugger-Friendly

    • Chapter 17. Conclusion

    • Appendix A. Source Code for the scpp Library Used in This Book

    • Appendix B. Source Code for the files scpp_assert.hpp and scpp_assert.cpp

    • Appendix C. Source Code for the file scpp_vector.hpp

    • Appendix D. Source Code for the file scpp_array.hpp

    • Appendix E. Source Code for the file scpp_matrix.hpp

    • Appendix F. Source Code for the file scpp_types.hpp

    • Appendix G. Source Code for the file scpp_refcountptr.hpp

    • Appendix H. Source Code for the file scpp_scopedptr.hpp

    • Appendix I. Source Code for the file scpp_ptr.hpp

    • Appendix J. Source Code for the file scpp_date.hpp and scpp_date.cpp

  • Index

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan