In C++ the std::optional class template represents an optional value, i.e. one that may or may not be present.
Further in my code, I check to see check if an object is null/empty. Is there a way to …