Intermediate C++
Q84 / 100

What is std::expected (C++23)?

Correct! Well done.

Incorrect.

The correct answer is B) A type holding either an expected value T or an unexpected error E, avoiding exception overhead for error handling

B

Correct Answer

A type holding either an expected value T or an unexpected error E, avoiding exception overhead for error handling

Explanation

std::expected<int, std::error_code> open(path) returns either a valid int or an error_code. Allows functional error handling without exceptions.

Progress
84/100