by WildUtah · 11y ago · 0 comments
(if-let [name name-whose-value-is-possibly-null]
(something-to-do name))
[0] https://clojuredocs.org/clojure.core/if-let if (mytype* p = find_or_null(blah))
foo(*p);
Still have to dereference p, but at least it's only in scope when doing so is safe. Also goes well with auto and std::optional: if (auto opt = find_or_none(blah))
foo(*opt);