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++

Partitioned search range

`std::lower_bound` does not need a fully sorted range: for the given key, all elements that pass its test must come before all elements that fail it.

Advanced · ISO C++23; implementation support may vary
C++

Placement new: construction in existing storage

Construct an object in a prepared slot, manage its lifetime separately from the storage, and make the slot owner explicitly non-copyable and non-movable.

Advanced · ISO C++23; implementation support may vary
C++

Pointer declarator (*) in C++

Learn how ISO C++23 uses `*` to declare pointers, where to put `const`, and how to distinguish a pointer to an array from an array of pointers.

Advanced · ISO C++23; implementation support may vary
C++

Forming pointers to members in C++

`&C::m` can identify a non-static member without choosing an object. Apply the resulting member pointer to an object or use it as a projection in a ranges algorithm.

Advanced · ISO C++23; implementation support may vary
C++

Preconditions and domain invariants

Separate caller obligations from valid object state. Validate external input independently of `assert`, and design the type’s public interface to preserve its invariant.

Advanced · ISO C++23; implementation support may vary
C++

Direct construction of a prvalue result

Since C++17, a same-type class prvalue constructs the result directly, without copying or moving the whole object. NRVO is optional, and member initialization can still copy data.

Advanced · ISO C++23; implementation support may vary
C++

Pure virtual function (= 0) in C++

Use `= 0` to declare a pure virtual member function and define an abstract interface. Calls through that interface can select different implementations based on the object's type.

Advanced · ISO C++23; implementation support may vary
C++

Range adaptor pipe operator `|`

Use `|` to apply an adaptor closure to a range or compose two closures into a reusable pipeline. This overload is distinct from built-in bitwise OR.

Advanced · ISO C++23; implementation support may vary
C++

Rvalue reference declarator (`&&`)

The `&&` declarator forms an rvalue reference type. Overload resolution still depends on expression category: the name of a variable declared `T&&` is an lvalue when passed as an argument.

Advanced · ISO C++23; implementation support may vary
C++

`std` — the C++ standard library namespace

Learn how to read names such as `std::cout` and `std::chrono::seconds`, make declarations available, and shorten names safely. Curriculum examples show what the namespace controls and what comes from each API’s own contract.

Intermediate · ISO C++23; implementation support may vary
C++

Appending to a string: std::basic_string::append

Choose the `append` overload that matches your source: a whole string, a slice, or a buffer with a known length. Add separators explicitly and preserve embedded nulls.

Advanced · ISO C++23; implementation support may vary
C++

std::basic_string constructor: repeat a character

Build a string containing exactly `count` copies of `ch`. Use parentheses to select the fill overload rather than the initializer-list overload.

Advanced · ISO C++23; implementation support may vary
C++

std::basic_string::push_back — append one code unit

Append one code unit to a string, directly or through an output iterator. Learn what growth can invalidate and how to preserve embedded nulls in bounded data.

Advanced · ISO C++23; implementation support may vary