C++std::next_permutation rearranges a range into its next lexicographical permutation. It returns true when a successor exists; after the final permutation, it restores the first arrangement and returns false.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::none_of from <algorithm> checks whether no element in a range satisfies a predicate. It returns bool: true means there are no matches, while false means at least one match exists. An empty range produces true.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::noop_coroutine() returns a non-null handle to a special coroutine whose resumption and destruction have no observable effects. It is not an empty handle.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::nth_element places an element at the position it would occupy after a full sort without sorting the entire range. It is useful for finding a median or the kth smallest element.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::numeric_limits<T> from <limits> exposes the limits and representation properties of T. Learn how min() differs from lowest(), what digits measures, and how to check IEC 559 conformance without assuming a particular type size.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::ofstream from <fstream> writes data to a file through a stream interface. Learn about default content replacement, appending, and checking errors when opening, writing, and closing a file.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::optional<T> represents either an object of type T or no value. It separates a missing result from valid values such as 0. Check that a value is present before using the * and -> operators.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::basic_ostream is an output-stream template, and std::ostream is its alias for char. They support formatting values with operator<< and writing characters to an associated stream buffer.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::ostringstream, declared in <sstream>, formats values into text stored in memory. It uses operator << like an output stream, while str() retrieves the result as a std::string.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::out_of_range, declared in <stdexcept>, reports an argument value outside its expected range. It carries a message available through what() and derives from std::logic_error.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::overflow_error, declared in <stdexcept>, reports arithmetic overflow. It does not detect overflow automatically: code must check bounds before a risky operation and explicitly throw the exception.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::packaged_task wraps a callable and stores its result or exception in shared state. std::packaged_task::get_future provides a std::future for retrieving that result; the task itself does not start a new thread.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::pair<T1, T2> groups two values, potentially of different types, in one object. Its public first and second data members provide direct access to the first and second elements.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::partial_ordering from <compare> represents a comparison result that can be less, equivalent, greater, or unordered. The unordered state means the values are incomparable, not equivalent.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::partial_sort selects the smallest k elements and places them in a sorted prefix of the range. It modifies the input, while the order of the remaining elements is unspecified.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::partial_sum from <numeric> writes successive prefix sums of a range. It also accepts a custom binary operation; its accumulator uses the input value type, independently of the output type.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::partition rearranges a range so that elements satisfying a predicate precede the others. It returns the boundary iterator between the groups, but does not guarantee that order within either group is preserved.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::plus from <functional> exposes operator + as a callable object. std::plus<T> fixes the type T, whereas std::plus<> deduces the argument types and the expression's result type.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::pmr::memory_resource is an abstract interface for allocating and deallocating storage with a specified alignment. It enables runtime selection of an allocation strategy, while std::pmr::polymorphic_allocator connects that interface to code expecting an allocator.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::pmr::monotonic_buffer_resource supplies storage for successive allocations while ignoring individual deallocations. release() returns upstream blocks and resets the resource for reuse.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::pmr::polymorphic_allocator<T>, declared in <memory_resource>, routes memory requests to a std::pmr::memory_resource object. It lets allocation strategies vary at runtime without changing the allocator type or the container type that uses it.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::pmr::string is a std::basic_string specialization using std::pmr::polymorphic_allocator<char>. It lets you select a memory resource at runtime without changing the string's type.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::pmr::synchronized_pool_resource manages pools of memory blocks and supports concurrent access from multiple threads. It can supply storage to PMR containers, but resource synchronization does not make concurrent modifications of a container safe.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::pmr::unsynchronized_pool_resource manages pools of memory blocks for polymorphic allocators. It allows deallocated blocks to be reused, but requires careful resource lifetimes and prevention of simultaneous access from multiple threads.
Intermediate · C++23; repository compiler flag, production runtime not attested