Code Snippets of Code snippets of C++11, C++14, C++17.
-
auto specifier:
Specifying that the type of the variable that is being declared will be automatically deduced from its initializer. <code>
-
constexpr:
Specifying that the value of a variable or function can appear in constant expressions. <code>
-
std::move:
Producing an xvalue expression that identifies its argument. <code>
-
std::atomic_flag:
An atomic boolean type. <code>
-
std::array:
A container that encapsulates fixed size arrays. <code>
-
std::forward_list:
A container that supports fast insertion and removal of elements from anywhere in the container. <code>
-
std::tuple:
A fixed-size collection of heterogeneous values. <code>
-
std::shared_ptr:
A smart pointer that retains shared ownership of an object through a pointer. <code>
-
std::unique_ptr:
A smart pointer that owns and manages another object through a pointer and disposes of that object when the unique_ptr goes out of scope. <code>
-
std::weak_ptr:
A smart pointer that holds a non-owning ("weak") reference to an object that is managed by
std::shared_ptr
. <code> -
Lambda expressions:
Constructs a closure: an unnamed function object capable of capturing variables in scope. <code>
-
std::async:
Running a function asynchronously. <code>
-
std::thread:
A single thread of execution. <code>
-
std::mutex:
A synchronization primitive that can be used to protect shared data from being simultaneously accessed by multiple threads. <code>
-
std::condition_variable:
A synchronization primitive that can be used to block a thread, or multiple threads at the same time, until another thread both modifies a shared variable (the condition), and notifies the condition_variable. <code>
-
std::chrono::system_clock:
The system-wide real time wall clock. <code>