std::chrono::duration: a count of ticks with a period
std::chrono::duration<Rep, Period> represents a time interval as a count of ticks whose period is a constant fraction of a second.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
std::chrono::duration<Rep, Period> represents a time interval as a count of ticks whose period is a constant fraction of a second.
std::chrono::duration_cast converts a duration to a specified std::chrono::duration type. If scaling requires integer division, the quotient is truncated toward zero after the count is converted to a common intermediate type. The function does not check for overflow.
std::chrono::steady_clock never moves backward as physical time advances and progresses at a steady rate.
std::chrono::system_clock represents system-wide real time and can map its time points to time_t.
std::chrono::time_point<Clock, Duration> stores an offset from a clock epoch and represents a point, not merely a length of time.
std::chrono::weekday represents a day of the week. Its c_encoding() method returns unsigned: for valid values, 0 means Sunday and 6 means Saturday. Check ok() before interpreting input values.
std::chrono::year_month_day stores year, month, and day fields. Constructing an object does not guarantee a valid date: ok() also checks month length and leap years.
std::cin is the standard input stream. Extraction with >> attempts to interpret input as the requested type, so the result of the operation must be checked.
std::clamp returns the lower bound, upper bound, or value itself so the result lies in an ordered interval.
std::clog is the global narrow output stream associated with C stderr, without a required unitbuf setting.
std::condition_variable blocks a thread while atomically unlocking a mutex and wakes it after notification, but the condition must always be checked again.
std::copy assigns every element of an input range to consecutive destination positions and returns the iterator past the last write.
std::copy_if tests every element, copies only those with a true predicate result, and returns the end of the written destination portion.
std::coroutine_handle is a copyable pointer-like reference to a coroutine frame and does not manage that frame’s lifetime by itself.
std::count traverses an entire range, compares each element with a value, and returns the hit count in the iterator’s difference_type.
std::count_if tests every element in a range with a predicate and returns the number of true results.
std::counting_semaphore maintains a permit count; acquire consumes a permit, while release returns permits and can unblock a waiter.
std::cout is an output-stream object declared in iostream. The << operator sends it values, using formatting appropriate to their types.
std::current_exception from <exception> returns a std::exception_ptr referring to the currently handled exception or a copy. It lets you retain an exception and rethrow it later; with no handled exception, it returns a null value.
std::dec selects base 10 for formatted integer output and input in a C++ stream. The change remains active for subsequent operations until the stream's numeric base setting is changed again.
std::decay transforms a type at compile time to model pass-by-value. std::decay_t exposes the resulting type without writing ::type.
std::declval from <utility> lets you inspect an expression's type without constructing an object. Use it in unevaluated operands, such as decltype; it must not be used for an actual evaluated call.
std::default_sentinel_t is an empty range-end marker type from <iterator>. It works with iterators that can determine the end themselves, such as std::counted_iterator. It is not a universal replacement for end().
std::deque provides fast operations at both ends and random access, but contiguous storage for all of its elements is not guaranteed.