Error reporting in C++ - Optional values (5/13)

Поділитися
Вставка
  • Опубліковано 7 кві 2024
  • Join me in these bi-weekly series to explore the topic of error reporting in C++.
    The focus of this course is the design of functions that normally return a value, but an error may occur so, what should they return instead?
    In this video we will be looking at reporting errors using optional values.
    Optional values are a type that can either hold a value or not. If we try to access the value of an optional that does not hold a value, an exception is thrown.
    This approach is simple to use and understand, protects the caller from accidentally accessing the payload if an error has occured and allows us to distinguish between an empty value and a missing value.
    The course is also available FOR FREE on Udemy.
    It includes coding exercises so you can practice what you have learned.
    Check it out and please consider leaving a review if you find it helpful: www.udemy.com/course/error-re...
  • Наука та технологія

КОМЕНТАРІ •