Intermediate C++
Q55 / 100

What is std::optional?

Correct! Well done.

Incorrect.

The correct answer is B) A wrapper that may or may not contain a value, representing an optional result without a null pointer

B

Correct Answer

A wrapper that may or may not contain a value, representing an optional result without a null pointer

Explanation

std::optional<T> (C++17) holds either a T or nothing. Check with .has_value() and access with .value() or operator*.

Progress
55/100