• by hedayet on 4/26/2025, 9:17:19 PM

    After all these years of returning magic values for “no result,” I finally came across std::optional<T> (added in C++17). It makes representing “maybe there’s a value, maybe not” so much cleaner and safer.

    Has anyone else had a “how did I live without this?” moment? What’s your favorite underrated C++ feature?