#include #include std::optional my_div(int a, int b) { if (b == 0) { return {}; } //return std::make_optional(a / b); return {a / b}; } int main() { auto opt = my_div(16, 0); //if (opt.has_value()) { if (opt) { std::cout << "Correct!\n"; //std::cout << opt.value() << '\n'; std::cout << *opt << '\n'; } else { std::cout << "Incorrect!\n"; // To jest terroryzm! std::cout << *opt << '\n'; } }