I have a function that returns a pointer to an object of type bool for a given name. If the object is not found, nullptr
is returned.
Now I would like to set a variable to the value of the returned boolean or false if not found. Can I write it like this?
bool flag = *Get("name");
Is this equivalent to this longer implementation?
bool *result = Get("name");
bool flag = result == nullptr ? false : *result;