std::fstream: bidirectional file stream
std::fstream connects character input and output to a named file while retaining formatting and stream-error state.
CKTIS / C++
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
std::fstream connects character input and output to a named file while retaining formatting and stream-error state.
std::function stores any copyable callable matching a selected signature and invokes it through one uniform interface.
std::future is a movable, non-copyable handle to one shared state containing either a value or an exception.
std::future_status is a scoped enumeration from <future>, returned by wait_for() and wait_until(). It distinguishes a ready result, an expired timeout, and deferred execution. The status itself neither retrieves the value nor tells you whether the computation completed without an exception.
std::generate calls a nullary generator exactly once for every position in a range and assigns each successive result.
C++23 std::generator turns a co_yield coroutine into a movable, single-pass range that produces elements on demand.
std::get selects an element by constant index or unique type and returns a reference that preserves value category and constness.
std::get_if returns a pointer to the requested active std::variant alternative or nullptr without throwing.
std::getline replaces a std::string with stream characters up to a delimiter that is extracted but not appended.
std::greater from <functional> creates a callable object that compares operands using >. Learn the distinction between std::greater<T> and the transparent std::greater<>.
std::hash<Key> maps a key to a std::size_t value and is the default hasher for unordered associative containers. Equal keys must have equal hashes, but equal hashes do not prove that the keys are equal.
std::hex selects base 16 for formatted integer output and input on a stream. The setting remains active until changed; it changes neither the numeric value nor the formatting of floating-point numbers.
std::holds_alternative<T> non-throwingly tests whether std::variant currently stores its unique T alternative.
std::ifstream connects character input operations to a file and retains formatting, EOF, and error state.
std::inclusive_scan writes at each position a reduction that includes the current input element and returns the result end.
std::initializer_list<T> accepts brace-enclosed elements as a read-only sequence. Copying the list object neither copies its elements nor extends their lifetime.
std::inner_product combines pairs from two ranges, folds them from init in order, and returns the accumulator.
std::inplace_merge stably merges two consecutive, already sorted subranges into the same range.
std::inserter creates an output iterator that calls the container's insert on each assignment. This lets an algorithm such as std::copy add elements at a chosen position instead of overwriting existing ones.
std::integral from <concepts> checks at compile time whether a type is integral. It includes bool and character types, preserves its result under const and volatile qualification, but rejects references, enumerations, and floating-point types.
std::integral_constant<T, v> represents the constant v of type T as a type. The <type_traits> header also provides std::bool_constant, std::true_type and std::false_type for expressing Boolean results in metaprogramming.
std::invalid_argument from <stdexcept> reports an invalid argument. It carries a diagnostic message available through what() and belongs to the std::logic_error exception hierarchy.
std::invoke calls functions, function objects, and member pointers through one perfect-forwarding interface.
std::ios_base stores a stream's formatting state. Learn how the setf overloads differ, what precision means, and how to enable fixed and boolalpha safely while preserving settings for later restoration.