Skip to content

ralfholly/happy-path-cppxx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Happy Path To Modern C++

Modern C++ can be really hard to learn! This project aims at teaching just the beauty of modern C++ -- not through documentation but through simple code snippets; corner cases are intentionally omitted.

Prerequisites

In order to benefit from this project, it's assumed that readers are already familiar with the C++98 language. This project aims at showing the "beautiful delta" between C++98 and modern C++.

C++11

Cross-cutting language aspects that are either considered to be part of the core language or are so small that they don't warrant their own chapter, e. g.:

  • Static assertions
  • auto types
  • Range-based for loops
  • initializer_list
  • constexpr expressions
  • Scoped enum
  • User-defined literals

Shows how the auto keyword works.

Demonstrates how to use lambda expressions.

Features that pertain mostly to classes, e. g:

  • final, override, default, delete specifiers
  • Constructor delegation
  • Initialization of non-static members

A primer on lvalues, rvalues, lvalue references and rvalue references.

Shows the motivation behind move semantics and how to implement it in your class.

Demonstrates the various aspecs of multi-threading, including:

  • Launching threads with std::thread
  • std::mutex and std::condition_variable
  • std::promise and std::future
  • Launching and synchronizing threads with std::async

Introduces smart pointers, e. g.:

  • std::unique_ptr
  • std::shared_ptr
  • std::weak_ptr

Gives an overview of the following containers:

  • std::array
  • std::forward_list
  • std::unordered_set and std::unordered_multiset
  • std::unordered_map and std::unordered_multimap

Introduces smart pointers, e. g.:

  • std::unique_ptr
  • std::shared_ptr
  • std::weak_ptr

Shows how to use variadic (arbitrary-number-of-argument) templates and what "perfect forwarding" is about.

Miscellaneous topics, like:

  • Algorithms
  • std::tuple
  • Memory alignment
  • Type traits

C++14

Cross-cutting language aspects that are either considered to be part of the core language or are so small that they don't warrant their own chapter, e. g.:

Upcoming topics

Lot's of C++14 stuff :-)

About

A painless way to learn modern C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published