Jump to content

C++ Language

100% developed
From Wikibooks, open books for an open world
C++ Language
A comprehensive and hierarchical description of the C++ programming language

Preface

[edit | edit source]

This wiki book describes the C++ programming language.

Thank you for reading this wiki book!

Table of Contents

[edit | edit source]
  1. Overview
  2. Preprocessing
    1. Macros
    2. Tokenization
    3. Preprocessing Strings
    4. Compile-time Constants
    5. Compile-time Assertions
    6. Conditional-Compilation
  3. Namespace
    1. Namespace Shortcuts
    2. Nesting
    3. Splitting across Files
    4. Named and Unnamed
  4. Type
    1. Hungarian Prefixes
    2. Boolean
    3. Literals
      1. Financial 1000-Markers
      2. Binary and Hexadecimal
      3. Custom Literals
    4. Bitwise Representation
      1. Ordering of Bytes
      2. Negative Value
      3. Bit Shifting
      4. Non-char Byte
      5. Bit Flags
    5. Max Value
      1. Overflow
      2. INT_MAX
    6. Conversion
      1. Promoting Small Integers
      2. Coercion
      3. Casting
    7. Enumeration
    8. Shortcuts
      1. Templated typedef
      2. From Another Variable
      3. From Initialization
      4. From a return Statement
      5. Trailing Return Type
    9. Variant
      1. Any-Variant
      2. Templated-Variant
      3. Optional-Value
    10. RTTI: RunTime Type Information
  5. Variables
    1. Lifetime and Scope
    2. Initialization
    3. Uniform Initialization
    4. Initialize without Constructor
    5. Decomposing-Auto
    6. Define at Same Time as Type
  6. Indirection
    1. Pointers
    2. Typed NULL
    3. Arrays
    4. Reference Variables
    5. Rvalue-References
      1. Move-Semantics
      2. Moving from this
      3. Perfect Forwarding
    6. Smart Pointers
      1. Risk from Raw Pointers
      2. Unique Ownership
      3. Shared Ownership
      4. Ownership Cycle
      5. Owning an Array
      6. Pointer to Base-Class
      7. Returning this
      8. Smart Compiler-Temporary
      9. Custom Destruction
      10. Template-Parameter
  7. Expressions
    1. Precedence
    2. Chain of Assignment
  8. Program Flow
    1. Loops
      1. Basic Loops
      2. Looping over a Collection
    2. The break Statement
      1. A Break in a Nested Loop
      2. Fallthrough in a Switch
    3. Return Value
    4. Parameters
      1. Default Parameter
      2. Unused Parameter
      3. Variable Number of Parameters
    5. Function Overloading
      1. Discrimination Criteria
      2. Across Inheritance
    6. Function-Pointer
    7. Deprecating a Function
  9. Objects
    1. Accessibility
    2. Unwanted Compiler-Generated Functions
    3. Constructors
      1. Ordering
      2. Initialization by Copy-Constructor
      3. Initialization by One-Parameter-Constructor
      4. Keeping Default Constructor
      5. Delegation within Class
      6. Memory Full
      7. Placement New
    4. Destructors
    5. Const Members
      1. Const Data Members
      2. Const Member Functions
    6. Static Members
      1. Static Data Members
      2. Static Member Functions
    7. Inheritance
      1. Polymorphism Syntax
      2. Qualification Syntax
      3. Restricted Overriding
      4. Multiple Inheritance
    8. Operator Overloading
    9. Nested Classes
    10. Pointer to Members
    11. Low-Level C Structures
      1. Union
      2. Flexible-Array-Member
      3. Bitfield
  10. Templates
    1. Templated-Functions
    2. Templated-Classes
    3. Templated-Variables
    4. Template-Parameters
      1. Default Template-Parameters
      2. Deducing Template-Parameters
      3. Variable Number of Template-Parameters
    5. Traits
      1. Unary Predicate Traits
      2. Binary Predicate Traits
      3. Array Traits
      4. Unary Transform Traits
      5. Binary Transform Traits
      6. S.F.I.N.A.E. Conditional-Compilation
    6. Metaprogramming
      1. Numeric Template-Parameters
      2. Collection of Types
    7. Concepts
  11. Error Handling
    1. Returning an Error Code
    2. Assertions
    3. C++ Exception Handling
  12. Standard Libraries
    1. C-Runtime
      1. Math
        1. Basic Math
        2. Trigonometry
        3. Rational Numbers
        4. Complex Numbers
        5. Miscellaneous Math
      2. Heap Memory
        1. Allocation
        2. Memory Manipulation
        3. Leaks
      3. Time
        1. Time as a String
        2. Precise Time
        3. Timespan as CPU Clockticks
      4. Basic Algorithms
        1. Search
        2. Quick Sort
      5. Executing a Shell Command
    2. STL: Standard Template Library
      1. Collection Classes
        1. Sequence Collections
          1. Vector
            1. Construction
            2. Size
            3. Equality
            4. Indexing
            5. Removing Items
            6. Inserting Items
            7. Assignment
          2. Vector of Bool
          3. STL-Array
          4. Deque
          5. List
          6. Forward-List
        2. Sorted Collections
          1. A Pair as one Item
          2. Tuple
          3. Map
            1. Construction
            2. Sort-Class
            3. Custom Sort-Class
            4. Size
            5. Equality
            6. Indexing
            7. Removing Items
            8. Inserting Items
            9. Assignment
          4. Multimap
          5. Set
          6. Multiset
          7. Hash-Table
      2. Iterators
        1. Basic Iterators
        2. Ranges
        3. Insert-Iterators
        4. Reverse-Iterators
        5. Stream-Iterators
        6. Custom Iterators
      3. Adapters
        1. Stack
        2. Queue
        3. Binary-Heap
      4. Callable-Objects
        1. A Function Name as a Value
        2. Member Function
        3. Implicit Getter-Function
        4. Functor
        5. Lambda
        6. Generic Lambda
        7. Binding a new Function
      5. Algorithms
        1. Usage with a C-Array
        2. Querying
          1. Counting
          2. Searching
          3. Accumulating
        3. Applying Item-by-Item
          1. Processing Item-by-Item
          2. Ignoring Prior Values
          3. Item-by-Item Combination of Two Collections
        4. Modifying
          1. Copying
          2. Removing
          3. Reordering
    3. Strings
      1. Unicode
      2. Avoiding Buffer-Overrun
      3. Character Categories
      4. C-String Manipulation
      5. String Class
        1. Construction
        2. Equality
        3. Indexing
        4. Inserting Characters
        5. Algorithms
      6. Casting Numeric Values
        1. Number to String
        2. String to Number
      7. AliasedStrings
      8. Regular Expressions
      9. Locale
    4. IOStreams
      1. Stringstream
      2. Streaming Custom Types
    5. Filesystem Access
      1. Moving and Deleting
      2. Directories
      3. Binary-Files
      4. Formatted I/O
      5. Newline-Converted-Files
      6. Size of a File
      7. Redirecting stdout
      8. Pipes
      9. Console I/O
      10. Streamed I/O
    6. Multithreading
      1. Thread Creation
      2. Critical Section
      3. Atomic Values
      4. Locks
      5. Events
      6. Return Value
      7. Semaphores
        1. Resource Management
        2. Fragment Ordering
        3. Ring Buffer
        4. Readers and Writers
      8. Monitors and Channels
    7. RNG: Random Number Generator
  13. Obsolete Features
    1. Trigraph Characters
    2. An Obsolete Smart Pointer
    3. Variadics before ANSI
    4. Obsolete Function Binding
    5. Boost Feature Graduation

Guidelines for Editors