Featured sample: Return multiple values
Copy elements from a range to another range or container.
Count the number of occurrences of a particular value in a range of elements.
Sort elements in a range into a given order.
Swap the contents of two containers.
Swap the values of two objects.
Implement the assignment operator with strong exception safety.
Delegate behavior to derived classes without incurring the cost of run-time polymorphism.
Implement a lexicographic ordering over class members.
Reduce dependencies on internal class details and improve encapsulation.
Remove compilation dependencies on internal class implementations and improve compile times.
Safely and efficiently implement RAII to encapsulate the management of dynamically allocated resources.
Utilise the value semantics of existing types to avoid having to implement custom copy and move operations.
Create a copy of an object through a pointer to its base type.
Unpack a tuple as the arguments of a function.
Allow argument values to be omitted when calling a function.
Pass fixed-size arrays to and from functions.
Return multiple values of different types from a function.
Process the contents of an input stream line-by-line.
Read a sequence of delimited values from a single line of an input stream into a standard container.
Ensure that multiple stream reads are successful before using the extracted values.
Share ownership of a dynamically allocated object with another unit of code.
Transfer unique ownership of a dynamically allocated object to another unit of code.
Avoid manual memory management to improve safety and reduce bugs and memory leaks.
Maintain a non-owning reference to a shared dynamically allocated object to break circular dependencies.
Random number generation
Choose a random element from a container.
Generate a random boolean value according to a bernoulli distribution.
Generate a random integer according to a uniform distribution.
Seed a random number engine with greater unpredictability.
Conditionally instantiate a class template depending on the template arguments.
Conditionally instantiate a function template depending on the template arguments.
Forward arguments of one function to another as though the wrapped function had been called directly.
Separate the complex construction of an object from its representation.
Extend the functionality of a class.