KUNAI-static-analyzer icon indicating copy to clipboard operation
KUNAI-static-analyzer copied to clipboard

C++ improvement: use of std::optional whenever a reference is returned

Open Fare9 opened this issue 2 years ago • 0 comments

In C++ 17 we have std::optional type for returning a std::nullopt whenever an asked object does not exists, there's a problem with methods that return a reference to an object because these cannot return a nullptr, for that reason it would be good to use the std::optional wrapper and the user can check if the object they asked for exists or not.

Fare9 avatar Jul 06 '22 18:07 Fare9