Created
May 27, 2025 21:37
-
-
Save ParadoxV5/4184f2f101e2cf25d59b79e6debddce5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <optional> | |
#include <cstdio> | |
int main() { | |
std::optional<int> optional_of_none(std::nullopt); | |
std::optional<std::optional<int>> optional_of_optional(optional_of_none); | |
std::printf( | |
"optional_of_none.has_value():\t%d\n" | |
"optional_of_optional.has_value():\t%d\n", | |
optional_of_none.has_value(), optional_of_optional.has_value() | |
); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment