Skip to content

Instantly share code, notes, and snippets.

@cobalthex
Last active May 30, 2021 06:38
Show Gist options
  • Select an option

  • Save cobalthex/4e9f344681927872ade12e0a97e2c609 to your computer and use it in GitHub Desktop.

Select an option

Save cobalthex/4e9f344681927872ade12e0a97e2c609 to your computer and use it in GitHub Desktop.
Good to knows

items with asterick (*) considered more advanced/esoteric

  1. Stack vs heap (memory)
    • What are both
    • when is the stack used
    • when is the heap used
    • how can the heap be avoided
    • performance of the heap
  2. Cache locality
  3. Object lifetime
    • RAII
    • Rule of zero, three, five
    • When is the default constructor called
    • When is the destructor called
    • When should you call a destructor manually
    • What is placement new, what is an example use case
    • When can/should the destructor be called manually
    • What are xvalues, rvalues, lvalues
    • When is the assignment operator used
    • When is the move operator used
    • What are references
    • When should references be used
    • When can a function return a reference
    • What are scope guards and how/when to use them
  4. Functions
    • Calling conventions *
    • Operator overloading
    • Cast operators (static_cast, reinterpret_cast, const_cast, dynamic_cast)
    • Casting unique/shared pointers (static_pointer_cast, etc.) *
    • Pointer to member operator *
  5. Pointers
    • Safety of pointers
    • const pointers vs pointer consts
    • Pointer arithmatic
    • Managed pointers (shared_ptr, unique_ptr)
    • Pointer aliasing and why it can be bad (And how to avoid it) *
  6. Arrays
    • arr* vs arr[]
    • measuring the length of an arr[] statically
  7. constexpr *
  8. templates
    • templates vs generics (language theory)
    • specialization
    • metaprogramming *
    • parameter packing *
    • parameter type checking *
    • type traits *
    • Forwarding variadic arguments (Ty&&...) *
  9. polymorphism
    • when it is good
    • when it is bad
    • virtual functions
    • when is polymporphism actually invoked (pointers vs direct methods)
    • when a vtable is created *
    • vtable performance
    • static polymorphism
    • curiously reocurring template pattern *
    • RTTI, benefits + downsides *
  10. type erasure
    • object slicing
    • alignment *
    • aliasing *
  11. C++ Standard library
    • allocators *
    • lists vs vectors vs deques
    • maps/sets vs unordered_* *
    • streams *
    • iterators *
    • std::function
    • type_traits *
    • is_* functions and how they work *
  12. Multithreading
    • atomics
    • mutexes and locking
    • thread local storage *
    • futures
    • asynchronous execution
    • thread safety annotations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment