Skip to content

Instantly share code, notes, and snippets.

@Eczbek
Last active March 24, 2025 12:34
Show Gist options
  • Save Eczbek/1af8afd411221819327fa5b5b0ff394b to your computer and use it in GitHub Desktop.
Save Eczbek/1af8afd411221819327fa5b5b0ff394b to your computer and use it in GitHub Desktop.
C++ resources and a rearrangement of `learncpp.com`

C++ resources and a rearrangement of learncpp.com

 

Tools

Books

Tutorial / Basics

Introduction / Getting Started

C++ Basics

C++ Basics: Functions and Files

Debugging C++ Programs

Fundamental Data Types

Control Flow

Error Detection and Handling

Constants and Strings

Operators

Compound Types: References and Pointers

Compound Types: Enums and Structs

Fixed-size arrays: std::array

Dynamic arrays: std::vector

Function Overloading and Function Templates

Scope, Duration, and Linkage

Type Conversion, Type Aliases, and Type Deduction

Introduction to Classes

More on Classes

Fixed-size arrays: C-style arrays

Dynamic Allocation

Move Semantics and Smart Pointers

Functions

Operator Overloading

Iterators and Algorithms

Object Relationships

Inheritance

Virtual Functions

Templates and Classes

Exceptions

Input and Output (I/O)

Bit Manipulation

Miscellaneous

 

Intermediate

std::format

Multithreading

Preprocessor

Reference collapsing

  • Explanation
  • Types of reference collapsing
    • Tuple method:
      1. If the member is an lvalue reference, return it unchanged (the result is an lvalue with the same constness as the member).
      2. 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).
      3. 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).
      4. 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.

Template metaprogramming

Coroutines

 

Miscellaneous

C++ Weekly (YouTube channel)

C++ Acronym Glossary

Fluent C++

Multi-Dimensional Analog Literals

Hardware effects

Less Known C

Expert C Programming - Deep C Secrets (Book)

C Interfaces and Implementations (Book)

The C Programming Language (Book)

Duff's device

Build Your Own Text Editor (Unix terminal manipulation)

Sockets Tutorial

Beej's Guides

GNU C Language Introduction and Reference Manual

 

Uses of auto:

  1. auto to deduce the converted to type in a function style conversion with parentheses: auto(42)
  2. auto to deduce the converted to type in a function style conversion with a braced-init-list: auto { 42 }
  3. auto to deduce the type allocated in a new-expression like: new auto(42)
  4. decltype(auto) to deduce the type allocated in a new-expression: new decltype(auto)(42)
  5. auto to declare a trailing return type: auto f() -> int;
  6. auto for structured bindings: auto [x] = std::tuple(42);
  7. auto to deduce the type in a simple-declaration: auto x = 42;
  8. decltype(auto) to deduce the type in a simple-declaration: decltype(auto) x = 42;
  9. auto to deduce the type in a condition: if (auto x = 42)
  10. decltype(auto) to deduce the type in a condition: if (decltype(auto) x = 42)
  11. auto to deduce the type in a for-range-declaration: for (auto x : std::vector<int>())
  12. decltype(auto) to deduce the type in a for-range-declaration: for (decltype(auto) x : std::vector<int>())
  13. auto for an implicit function template parameter in the declaration of a function parameter: void f(auto x)
  14. auto to deduce the type in a template parameter: template<auto x>
  15. decltype(auto) to deduce the type in a template parameter: template<decltype(auto) x>
  16. auto to deduce the return type of a function definition or declaration: auto f() {}
  17. decltype(auto) to deduce the return type of a function definition or declaration: decltype(auto) f() {}
  18. trailing return type -> auto to deduce the the return type of a function definition or declaration or lambda: [] -> auto {}
  19. trailing return type -> decltype(auto) to deduce the the return type of a function definition or declaration or lambda: [] -> decltype(auto) {}
  20. operator auto to deduce the return type of a conversion operator
  21. operator decltype(auto) to deduce the return type of a conversion operator
  22. auto to deduce the type of a std::initializer_list: auto x = { 1, 2, 3 };

 

Discord servers

 

 

 

 

 

Credits:
 - mcmlevi for rearranging the chapters of learncpp.com
 - halalaluyafail3 for describing the tuple method of reference collapsing and describing all uses of auto

@supsm
Copy link

supsm commented Dec 2, 2024

hi eczbek

@cobrexus
Copy link

hi eczbek

@deqyra
Copy link

deqyra commented Mar 24, 2025

hi eczbek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment