Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 1.806 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
1.806
Dung lượng
5,51 MB
Nội dung
• • • • • • Table of Contents Index Reviews Examples Reader Reviews Errata C++ in a Nutshell By Ray Lischner Publisher : O'Reilly Date : May 2003 Published ISBN : 0-596-00298-X Pages : 808 Slots : 1 C++ in a Nutshell packs an enormous amount of information on C++ (and the many libraries used with it) in an indispensable quick reference for those who live in a deadline-driven world and need the facts but not the frills Cross-references link related methods, classes, and other key features This is an ideal resource for students as well as professional programmers • • • • • • Table of Contents Index Reviews Examples Reader Reviews Errata C++ in a Nutshell By Ray Lischner Publisher : O'Reilly Date : May 2003 Published ISBN : 0-596-00298-X Pages : 808 Slots : 1 Copyright Preface Structure of This Book About the Examples Conventions Used in This Book Comments and Questions For More Information Acknowledgments Chapter 1 Language Basics Section 1.1 Compilation Steps Section 1.2 Tokens Section 1.3 Comments Section 1.5 Alternative Tokens Section 1.4 Character Sets Section 1.6 Trigraphs Chapter 2 Declarations Section 2.1 Declarations and Definitions Section 2.2 Scope Section 2.4 Linkage Section 2.6 Object Declarations Section 2.3 Name Lookup Section 2.5 Type Declarations Section 2.7 Namespaces Chapter 3 Expressions Section 3.1 Lvalues and Rvalues Section 3.2 Type Conversions Section 3.3 Constant Expressions Section 3.4 Expression Evaluation Section 3.5 Expression Rules Chapter 4 Statements Section 4.1 Expression Statements Section 4.2 Declarations Section 4.4 Selections Section 4.6 Control Statements Section 4.3 Compound Statements Section 4.5 Loops Section 4.7 Handling Exceptions Chapter 5 Functions Section 5.1 Function Declarations Section 5.2 Function Definitions Section 5.3 Function Overloading Section 5.4 Operator Overloading Section 5.5 The main Function Chapter 6 Classes Section 6.1 Class Definitions Section 6.2 Data Members Section 6.4 Inheritance Section 6.3 Member Functions Section 6.5 Access Specifiers Section 6.6 Friends Section 6.7 Nested Types Chapter 7 Templates Section 7.1 Overview of Templates Section 7.2 Template Declarations Section 7.4 Class Templates Section 7.6 Partial Specialization Section 7.8 Name Lookup Section 7.3 Function Templates Section 7.5 Specialization Section 7.7 Instantiation Section 7.9 Tricks with Templates Section 7.10 Compiling Templates Chapter 8 Standard Library Section 8.1 Overview of the Standard Library Section 8.2 C Library Wrappers Section 8.4 Traits and Policies Section 8.3 Wide and Multibyte Characters Section 8.5 Allocators Section 8.6 Numerics Chapter 9 Input and Output Section 9.1 Introduction to I/O Streams Section 9.2 Text I/O Section 9.4 Stream Buffers Section 9.3 Binary I/O Section 9.5 Manipulators Section 9.6 Errors and Exceptions Chapter 10 Containers, Iterators, and Algorithms Section 10.1 Containers Section 10.2 Iterators Section 10.3 Algorithms Chapter 11 Preprocessor Reference # operator and directive ## operator #define directive defined operator #elif directive #endif directive #if directive #ifndef directive #line directive #else directive #error directive #ifdef directive #include directive #pragma directive #undef directive Chapter 12 Language Reference and operator and_eq operator auto storage class bitor operator break statement catch keyword class keyword const qualifier continue statement declarator delete operator double type else keyword asm definition bitand operator bool type case keyword char type compl operator const_cast operator declaration default keyword do statement dynamic_cast operator enum keyword explicit specifier export specifier extern storage class float type friend specifier goto statement if statement int type mutable specifier new operator not_eq operator or operator private access specifier public access specifier reinterpret_cast operator short type sizeof operator static storage class struct keyword template keyword expression false literal for statement function identifier inline specifier long type namespace keyword not operator operator keyword or_eq operator protected access specifier register storage class return statement signed specifier statement static_cast operator switch statement this keyword throw operator true literal type typeid operator unsigned specifier using keyword void keyword wchar_t type xor operator try statement typedef keyword typename keyword union keyword virtual specifier volatile qualifier while statement xor_eq operator Chapter 13 Library Reference Section 13.1 Section 13.2 Section 13.3 Section 13.5 Section 13.7 Section 13.9 Section 13.11 Section 13.13 Section 13.15 Section 13.17 Section 13.19 Section 13.4 Section 13.6 Section 13.8 Section 13.10 Section 13.12 Section 13.14 Section 13.16 Section 13.18 Section 13.20 Section 13.21 Section 13.22 Section 13.24 Section 13.26 Section 13.28 Section 13.30 Section 13.32 Section 13.34 Section 13.36 Section 13.38 Section 13.40 Section 13.42 Section 13.44 Section 13.46 Section 13.48 Section 13.50 Section 13.23 Section 13.25 Section 13.27 Section 13.29 Section 13.31 Section 13.33 Section 13.35 Section 13.37 Section 13.39 Section 13.41 Section 13.43 Section 13.45 Section 13.47 Section 13.49 Section 13.51 Appendix A Compiler Extensions Section A.1 Borland C++ Builder and Kylix Section A.2 GNU Compiler Collection Section A.3 Microsoft Visual C++ Appendix B Projects Section B.1 Blitz++ Section B.2 Boost Section B.3 STLport Glossary A-Z Colophon Index templates bitset class [See class templates] compiling container, implementing your own declarations versus specializations declaring and defining defined examples function [See function templates] instantiation 2nd example explicit member [See member templates] name lookup and dependent names hiding names resolving names type names operator overload resolution and overview parameters specializing [See specializing templates] tricks with wrapper temporary objects, binding names to terminate function ( header) test function (bitset class template) testing for I/O success text I/O this expression, defined this keyword examples this pointers and static member functions thousands_sep (lconv member) thousands_sep function (moneypunct class template) _ _thread keyword (RAD extension) throw expressions 2nd tie function (basic_ios class template) tilde (~),destructor names time and dates time function ( header) _ _TIME_ _ macro time_base class ( header) time_get class template ( header) time_get_byname class template ( header) time_put class template ( header) time_put_byname class template ( header) time_t type ( header) tinyness_before member (numeric_limits class template) tm struct ( header) ( header) TMP_MAX macro ( header) tmpfile function ( header) tmpnam function ( header) to_char_type function (char_traits class) to_double member function to_int_type function (char_traits class) to_string function (bitset class template) to_ulong function (bitset class template) tokens alternative differences between preprocessor token and compiler token tolower function ( header) tolower function template ( header) top function (priority_queue class template) (stack class template) toupper function ( header) toupper function template ( header) towctrans function ( header) towlower function ( header) towupper function ( header) trait templates, commonly used traits character custom iterator transform algorithm transform function transform function template ( header) traps member (numeric_limits class template) trigraphs, defined trivial classes trunc literal try statements examples two-phase lookup type casts conversions arithmetic explicit declarations lists membership, testing simple uses of polymorphism [See polymorphism] promotions 2nd specifiers fundamental type polymorphism (glossary definition) type_info class ( header) typedef declarations 2nd language linkage and typeid operator typename keyword 2nd 3rd declaring type template parameters template declarations and typeof keyword (GNU compiler) [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] UCHAR_MAX macro ( header) uflow function (basic_filebuf class template) (basic_streambuf class template) UINT_MAX macro ( header) ULONG_MAX macro ( header) unary expressions unary_function class template ( header) unary_negate class template ( header) uncaught_exception function ( header) undefined behavior (glossary definition) underflow function (basic_filebuf class template) (basic_streambuf class template) (basic_stringbuf class template) (strstreambuf class) underflow_error class ( header) underscores identifiers starting with identifiers with two consecutive unexpected constructor calls unexpected function ( header) unformatted I/O unget function (basic_istream class template) ungetc function ( header) ungetwc function ( header) Unicode characters in source file uninitialized_copy function template ( header) uninitialized_fill function template ( header) uninitialized_fill_n function template ( header) union keyword C versus C++ unions anonymous [See anonymous unions] C versus C++ versus inheritance unique function (list class template) unique function template ( header) 2nd unique_copy function template ( header) 2nd unitbuf function ( header) unitbuf literal universal characters compilers and unnamed namespace unqualified function calls 2nd unqualified name unqualified name lookup unsetf function (ios_base class) unshift function (codecvt class template) unsigned char type unsigned long int type unsigned short int type upper_bound function (map class template) (multimap class template) (multiset class template) (set class template) upper_bound function template ( header) 2nd uppercase function ( header) uppercase literal use_facet function template ( header) user-defined conversion sequence USHRT_MAX macro ( header) using declarations 2nd using directives 2nd within classes or namespaces UTF-32 encoding _ _uuidof operator (RAD extension) [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] va_arg macro ( header) va_end macro ( header) va_list type ( header) va_start macro ( header) valarray class template ( header) what should have been valarray class templates _ _value class (Managed C++ extension) value type containers requirements in value_comp function (map class template) (multimap class template) (multiset class template) (set class template) value_type function (allocator class template) vector class template ( header) 2nd vector class ( header) 2nd vector::reference class ( header) vector, inserting numbers in a vfprintf function ( header) vfwprintf function ( header) virtual base classes virtual destructors virtual function tables virtual functions 2nd calling declaring and using default arguments and overridden overriding pure slicing and specifiers virtual inheritance virtual specifier Visual C++ compiler void type volatile objects volatile specifiers [See cv-qualifiers] vprintf function ( header) vsprintf function ( header) vswprintf function ( header) vtables vwprintf function ( header) [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] wcerr variable ( header) WCHAR_MAX macro ( header) WCHAR_MIN macro ( header) wchar_t type Unicode UTF-32 encoding and wcin variable ( header) wclog variable ( header) wcout variable ( header) wcrtomb function ( header) wcscat function ( header) wcschr function ( header) wcscmp function ( header) wcscoll function ( header) wcscpy function ( header) wcscspn function ( header) wcsftime function ( header) wcslen function ( header) wcsncat function ( header) wcsncmp function ( header) wcsncpy function ( header) wcspbrk function ( header) wcsrchr function ( header) wcsrtombs function ( header) wcsspn function ( header) wcsstr function ( header) wcstod function ( header) wcstok function ( header) wcstol function ( header) wcstombs function ( header) wcstoul function ( header) wcsxfrm function ( header) wctob function ( header) wctomb function ( header) wctrans function ( header) wctrans_t type ( header) wctype function ( header) wctype_t type ( header) web page, authorÕs well-formed (glossary definition) WEOF macro ( header) ( header) wfilebuf class ( header) wfstream class ( header) while statements declaration whitespace and symbols whitespace characters wide characters 2nd converting to multibyte characters wide string literals widen function (basic_ios class template) (ctype class template) width function (ios_base class) wifstream class ( header) wint_t type ( header) ( header) wiostream class ( header) wistream class ( header) wistringstream class ( header) wmemchr function ( header) wmemcmp function ( header) wmemcpy function ( header) wmemmove function ( header) wmemset function ( header) wofstream class ( header) wostream class ( header) wostringstream class ( header) wprintf function ( header) wrapper template write function (basic_ostream class template) 2nd ws function ( header) wscanf function ( header) wstreambuf class ( header) wstring class ( header) 2nd wstringbuf class ( header) wstringstream class ( header) [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] xalloc function (ios_base class) xor (exclusive or) xsgetn function (basic_streambuf class template) xsputn function (basic_streambuf class template) ... // Illegal: cannot repeat a suffix 1.2.3.2 Floating-point literals A floating-point literal has an integer part, a decimal point, a fractional part, and an exponent part You must include the decimal point, the exponent, or both... Each native end-of-line character or character sequence is replaced by a newline character If a backslash character is followed immediately by a newline character, delete the backslash and the newline The backslash/newline combination must not fall in the middle of a. .. sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and O'Reilly & Associates, Inc was aware of a trademark claim, the designations have been printed in caps or initial caps