C++ resources and a rearrangement of learncpp.com
- cppreference (C/C++ Documentation)
- Compiler Explorer (Running and sharing code)
- Coliru (Somewhat similar)
- C++ Standard Working Draft
- C++ Insights (How compilers actually see code)
- cdecl+ (Readable C declarations)
- Quick C++ Benchmarks
- C++ Build Benchmarks
- uiCA
- Decompiler Explorer
- Introduction to these tutorials
- Introduction to programming languages
- Introduction to C/C++
- Introduction to C++ development
- Introduction to the compiler, linker, and libraries
- Installing an Integrated Development Environment (IDE)
- Compiling your first program
- A few common C++ problems
- Configuring your compiler: Build configurations
- Configuring your compiler: Compiler extensions
- Configuring your compiler: Warning and error levels
- Configuring your compiler: Choosing a language standard
- What language standard is my compiler using?
- Statements and the structure of a program
- Comments
- Introduction to objects and variables
- Variable assignment and initialization
- Introduction to iostream:
std::cout
,std::cin
, andstd::endl
- Uninitialized variables and undefined behavior
- Keywords and naming identifiers
- Whitespace and basic formatting
- Introduction to literals and operators
- Introduction to expressions
- Developing your first program
- Summary and quiz
- Additional:
- Introduction to functions
- Function return values (value-returning functions)
- Void functions (non-value returning functions)
- Introduction to function parameters and arguments
- Introduction to local scope
- Why functions are useful, and how to use them effectively
- Forward declarations and definitions
- Programs with multiple code files
- Naming collisions and an introduction to namespaces
- Introduction to the preprocessor
- Header files
- Header guards
- How to design your first programs
- Summary and quiz
- Additional:
- Syntax and semantic errors
- The debugging process
- A strategy for debugging
- Basic debugging tactics
- More debugging tactics
- Using an integrated debugger: Stepping
- Using an integrated debugger: Running and breakpoints
- Using an integrated debugger: Watching variables
- Using an integrated debugger: The call stack
- Finding issues before they become problems
- Summary and quiz
- Introduction to fundamental data types
- Void
- Object sizes and the sizeof operator
- Signed integers
- Unsigned integers, and why to avoid them
- Fixed-width integers and
std::size_t
- Introduction to scientific notation
- Floating point numbers
- Boolean values
- Introduction to if statements
- Chars
- Introduction to type conversion and
static_cast
- Summary and quiz
- Control flow introduction
- If statements and blocks
- Common if statement problems
- Constexpr if statements
- Switch statement basics
- Switch fallthrough and scoping
- Goto statements
- Introduction to loops and while statements
- Do while statements
- For statements
- Break and continue
- Halts (exiting your program early)
- Introduction to random number generation
- Generating random numbers using Mersenne Twister
- Global random numbers (Random.h)
- Summary and quiz
- Introduction to testing your code
- Code coverage
- Common semantic errors in C++
- Detecting and handling errors
- std::cin and handling invalid input
- Assert and static_assert
- Summary and quiz
- Constant variables (named constants)
- Literals
- Numeral systems (decimal, binary, hexadecimal, and octal)
- Constant expressions and compile-time optimization
- Constexpr variables
- The conditional operator
- Inline functions and variables
- Constexpr and consteval functions
- Introduction to
std::string
- Introduction to
std::string_view
std::string_view
(part 2)- Summary and quiz
- Operator precedence and associativity
- Arithmetic operators
- Remainder and Exponentiation
- Increment/decrement operators, and side effects
- The comma operator
- Relational operators and floating point comparisons
- Logical operators
- Summary and quiz
- Introduction to compound data types
- Value categories (lvalues and rvalues)
- Lvalue references
- Lvalue references to const
- Pass by lvalue reference
- Pass by const lvalue reference
- Introduction to pointers
- Null pointers
- Pointers and const
- Pass by address
- Pass by address (part 2)
- Return by reference and return by address
- In and out parameters
- Type deduction with pointers, references, and const
std::optional
- Summary and quiz
- Additonal:
- Introduction to program-defined (user-defined) types
- Unscoped enumerations
- Unscoped enumerator integral conversions
- Converting an enumeration to and from a string
- Introduction to overloading the I/O operators
- Scoped enumerations (enum classes)
- Introduction to structs, members, and member selection
- Struct aggregate initialization
- Default member initialization
- Passing and returning structs
- Struct miscellany
- Member selection with pointers and references
- Class templates
- Class template argument deduction (CTAD) and deduction guides
- Alias templates
- Chapter 13 summary and quiz
- Using a language reference
- Introduction to
std::array
std::array
length and indexing- Passing and returning
std::array
std::array
of class types, and brace elision- Arrays of references via
std::reference_wrapper
std::array
and enumerations- Multidimensional
std::array
- Introduction to containers and arrays
- Introduction to
std::vector
and list constructors std::vector
and the unsigned length and subscript problem- Passing
std::vector
- Returning
std::vector
, and an introduction to move semantics - Arrays and loops
- Arrays, loops, and sign challenge solutions
- Range-based for loops (for-each)
- Array indexing and length using enumerators
std::vector
resizing and capacitystd::vector
and stack behaviorstd::vector<bool>
- Summary and quiz
- Introduction to function overloading
- Function overload differentiation
- Function overload resolution and ambiguous matches
- Deleting functions
- Default arguments
- Function templates
- Function template instantiation
- Using function templates in multiple files
- Function templates with multiple template types
- Non-type template parameters
- Summary and quiz
- Additional:
- User-defined namespaces and the scope resolution operator
- Local variables
- Introduction to global variables
- Variable shadowing (name hiding)
- Internal linkage
- External linkage and variable forward declarations
- Why (non-const) global variables are evil
- Sharing global constants across multiple files (using inline variables)
- Static local variables
- Scope, duration, and linkage summary
- Using declarations and using directives
- Unnamed and inline namespaces
- Summary and quiz
- Implicit type conversion
- Floating-point and integral promotion
- Numeric conversions
- Narrowing conversions, list initialization, and constexpr initializers
- Arithmetic conversions
- Explicit type conversion (casting) and
static_cast
- Typedefs and type aliases
- Type deduction for objects using the
auto
keyword - Type deduction for functions
- Summary and quiz
- Additional:
- Introduction to object-oriented programming
- Introduction to classes
- Member functions
- Const class objects and const member functions
- Public and private members and access specifiers
- Access functions
- Member functions returning references to data members
- The benefits of data hiding (encapsulation)
- Introduction to constructors
- Constructor member initializer lists
- Default constructors and default arguments
- Delegating constructors
- Temporary class objects
- Introduction to the copy constructor
- Class initialization and copy elision
- Converting constructors and the
explicit
keyword - Constexpr aggregates and classes
- Summary and quiz
- The hidden "this" pointer and member function chaining
- Classes and header files
- Nested types (member types)
- Introduction to destructors
- Class templates with member functions
- Static member variables
- Static member functions
- Friend non-member functions
- Friend classes and friend member functions
- Reference qualifiers
- Chapter 15 summary and quiz
- Additional:
- Introduction to C-style arrays
- C-style array decay
- Pointer arithmetic and subscripting
- C-style strings
- C-style string symbolic constants
- Multidimensional C-style Arrays
- Summary and quiz
- Dynamic memory allocation with new and delete
- Dynamically allocating arrays
- Destructors
- Pointers to pointers and dynamic multidimensional arrays
- Void pointers
- Introduction to smart pointers and move semantics
- R-value references
- Move constructors and move assignment
std::move
std::unique_ptr
std::shared_ptr
- Circular dependency issues with
std::shared_ptr
, andstd::weak_ptr
- Summary and quiz
- Function pointers
- The stack and the heap
- Recursion
- Command line arguments
- Ellipsis (and why to avoid them)
- Introduction to lambdas (anonymous functions)
- Lambda captures
- Summary and quiz
- Additional:
- Introduction to operator overloading
- Overloading the arithmetic operators using friend functions
- Overloading operators using normal functions
- Overloading the I/O operators
- Overloading operators using member functions
- Overloading unary operators
+
,-
, and!
- Overloading the comparison operators
- Overloading the increment and decrement operators
- Overloading the subscript operator
- Overloading the parenthesis operator
- Overloading typecasts
- Overloading the assignment operator
- Shallow vs. deep copying
- Overloading operators and function templates
- Summary and quiz
- Project
- Sorting an array using selection sort
- Introduction to iterators
- Introduction to standard library algorithms
- Timing your code
- Object relationships
- Composition
- Aggregation
- Association
- Dependencies
- Container classes
std::initializer_list
- Summary and quiz
- Introduction to inheritance
- Basic inheritance in C++
- Order of construction of derived classes
- Constructors and initialization of derived classes
- Inheritance and access specifiers
- Adding new functionality to a derived class
- Calling inherited functions and overriding behavior
- Hiding inherited functionality
- Multiple inheritance
- Summary and quiz
- Pointers and references to the base class of derived objects
- Virtual functions and polymorphism
- The override and final specifiers, and covariant return types
- Virtual destructors, virtual assignment, and overriding virtualization
- Early binding and late binding
- The virtual table
- Pure virtual functions, abstract base classes, and interface classes
- Virtual base classes
- Object slicing
- Dynamic casting
- Printing inherited classes using
operator<<
- Summary and quiz
- Template classes
- Template non-type parameters
- Function template specialization
- Class template specialization
- Partial template specialization
- Partial template specialization for pointers
- Summary and quiz
- The need for exceptions
- Basic exception handling
- Exceptions, functions, and stack unwinding
- Uncaught exceptions and catch-all handlers
- Exceptions, classes, and inheritance
- Rethrowing exceptions
- Function try blocks
- Exception dangers and downsides
- Exception specifications and noexcept
std::move_if_noexcept
- Summary and quiz
- Additional:
- Input and output (I/O) streams
- Input with
std::istream
- Output with
std::ostream
andstd::ios
- Stream classes for strings
- Stream states and input validation
- Basic file I/O
- Random file I/O
- Bit flags and bit manipulation via
std::bitset
- Bitwise operators
- Bit manipulation with bitwise operators and bit masks
- Converting integers between binary and decimal representation
- Additional:
- Static and dynamic libraries
- Using libraries with Visual Studio
- Using libraries with Code::Blocks
- C++ FAQ
- Additional:
- Pre-defined Compiler Macros Wiki
- The Preprocessor Iceberg Meme
- Recursive macros with C++20
__VA_OPT__
- Egor's macro placeholders
- Explanation
- Types of reference collapsing
- Tuple method:
- If the member is an lvalue reference, return it unchanged (the result is an lvalue with the same constness as the member).
- If the member is an rvalue reference and the tuple is an rvalue, return it unchanged (the result is an xvalue with the same constness as the member).
- If the member is an rvalue reference and the tuple is an lvalue, return it changed to an lvalue (the result is an lvalue with the same constness as the member).
- Otherwise, the member is not a reference and the result is an lvalue if the tuple is an lvalue, and xvalue if the tuple is an rvalue, and is const if either the tuple is const or the member is const.
- Tuple method:
- Understanding LIFT(F) Macro and Its
std::invoke
-like Behavior - Stateful metaprogramming
C++ Weekly (YouTube channel)
Multi-Dimensional Analog Literals
Expert C Programming - Deep C Secrets (Book)
C Interfaces and Implementations (Book)
The C Programming Language (Book)
Build Your Own Text Editor (Unix terminal manipulation)
GNU C Language Introduction and Reference Manual
auto
to deduce the converted to type in a function style conversion with parentheses:auto(42)
auto
to deduce the converted to type in a function style conversion with a braced-init-list:auto { 42 }
auto
to deduce the type allocated in a new-expression like:new auto(42)
decltype(auto)
to deduce the type allocated in a new-expression:new decltype(auto)(42)
auto
to declare a trailing return type:auto f() -> int;
auto
for structured bindings:auto [x] = std::tuple(42);
auto
to deduce the type in a simple-declaration:auto x = 42;
decltype(auto)
to deduce the type in a simple-declaration:decltype(auto) x = 42;
auto
to deduce the type in a condition:if (auto x = 42)
decltype(auto)
to deduce the type in a condition:if (decltype(auto) x = 42)
auto
to deduce the type in a for-range-declaration:for (auto x : std::vector<int>())
decltype(auto)
to deduce the type in a for-range-declaration:for (decltype(auto) x : std::vector<int>())
auto
for an implicit function template parameter in the declaration of a function parameter:void f(auto x)
auto
to deduce the type in a template parameter:template<auto x>
decltype(auto)
to deduce the type in a template parameter:template<decltype(auto) x>
auto
to deduce the return type of a function definition or declaration:auto f() {}
decltype(auto)
to deduce the return type of a function definition or declaration:decltype(auto) f() {}
- trailing return type
-> auto
to deduce the the return type of a function definition or declaration or lambda:[] -> auto {}
- trailing return type
-> decltype(auto)
to deduce the the return type of a function definition or declaration or lambda:[] -> decltype(auto) {}
operator auto
to deduce the return type of a conversion operatoroperator decltype(auto)
to deduce the return type of a conversion operatorauto
to deduce the type of astd::initializer_list
:auto x = { 1, 2, 3 };
- Together C & C++ (Help and general discussion)
- #include <C++> (General discussion)
Credits:
- mcmlevi
for rearranging the chapters of learncpp.com
- halalaluyafail3
for describing the tuple method of reference collapsing and describing all uses of auto
hi eczbek