Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Knowledge base

Knowledge base

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

Entries: 5788

C++

std::greater — a greater-than comparison object

std::greater from <functional> creates a callable object that compares operands using >. Learn the distinction between std::greater<T> and the transparent std::greater<>.

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

std::hash — function object for hashing keys

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.

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

std::hex — hexadecimal integer output and input

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.

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

std::ifstream: input file stream

std::ifstream connects character input operations to a file and retains formatting, EOF, and error state.

Intermediate · C++23
C++

std::initializer_list — access to list elements

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.

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

std::inserter — insertion through an output iterator

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.

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

std::integral — constraining integer types

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.

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

std::integral_constant — a constant as a type

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.

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

std::invalid_argument — invalid argument exception

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.

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

std::ios_base: formatting flags and precision

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.

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

std::ios_base::sync_with_stdio — synchronizing C++ and C streams

std::ios_base::sync_with_stdio controls synchronization between the standard C++ streams and C library streams. Calling it with false allows them to operate independently; the function returns the previous state, not a success indicator.

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

std::isalpha — checking whether a character is a letter

std::isalpha from <cctype> checks whether a value represents a letter under the current C locale. It returns int: zero or a nonzero value. To classify a char value, convert it to unsigned char and pass the result only if it fits in int.

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

std::is_convertible — testing implicit conversion

std::is_convertible checks at compile time whether From can be implicitly converted to To. std::is_convertible_v exposes the same bool value without ::value; success does not guarantee value preservation or freedom from exceptions.

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

std::isdigit — checking for digits

std::isdigit from <cctype> checks whether a character is a decimal digit. It returns int, not bool. After converting a character to unsigned char, the resulting value must fit in int.

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

std::is_heap — checking the heap property

std::is_heap checks whether a range satisfies the heap property without changing its elements. By default it recognizes a max-heap; a custom comparator lets you check another ordering, such as a min-heap.

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

std::is_nothrow_copy_constructible — non-throwing copy construction

This <type_traits> trait checks at compile time whether constructing T from const T& is valid and known not to throw. std::is_nothrow_copy_constructible<T>::value and std::is_nothrow_copy_constructible_v<T> expose the same bool result.

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

std::is_nothrow_destructible — checking non-throwing destruction

A <type_traits> trait that checks at compile time whether destruction is valid and cannot propagate an exception. std::is_nothrow_destructible<T>::value and std::is_nothrow_destructible_v<T> expose the same bool result.

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