Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C++

Knowledge base — C++

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 674

C++

std::cout: writing standard output

std::cout is an output-stream object declared in iostream. The << operator sends it values, using formatting appropriate to their types.

Basic · C++23
C++

std::current_exception — retain the handled exception

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.

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::dec — decimal integer formatting for streams

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.

Basic · C++23; repository compiler flag, production runtime not attested
C++

std::declval — inspect expressions without constructing an object

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.

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::default_sentinel_t — range-end marker

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().

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::enable_if and std::enable_if_t — conditionally exposing a type

std::enable_if exposes a type only when a compile-time condition is true. The std::enable_if_t alias shortens the spelling; in an appropriate substitution context, it lets SFINAE remove candidates from overload resolution.

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::endian — byte order

std::endian from <bit> describes the byte order of scalar types in the execution environment. Compare native with little and big, while also handling the special cases.

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::endl — newline and stream-buffer flush

std::endl inserts a newline and calls flush() on an output stream. Unlike '\n', it explicitly requests buffer synchronization; use it when you need both operations.

Basic · C++23; repository compiler flag, production runtime not attested
C++

std::equal_to — equality function object

std::equal_to from <functional> wraps operator ==. The typed T form returns bool, while std::equal_to<> deduces both argument types.

Basic · C++23; repository compiler flag, production runtime not attested
C++

std::errc — portable error conditions

std::errc is a scoped enumeration from <system_error>. It distinguishes named error conditions, including invalid_argument and result_out_of_range. With std::from_chars, check both ec and ptr when the entire input must be consumed.

Intermediate · C++23; repository compiler flag, production runtime not attested