title: Does C++ have some equivalent of SQL coalesce?
body: <p>In SQL, <code>COALESCE(val_1, val_2, ... val_n)</code> <a href="https://www.w3schools.com/SQL/func_sqlserver_coalesce.asp" rel="nofollow noreferrer">is</a> a variadic function which returns its first non-null argument, or null otherwise.</p>
  <p>Now, in C++, we have pointers which can be null, but also <code>std::optional</code>'s since C++17, and there's <code>std::variant</code> which could be null or hold the monostate type.</p>
  <p>Is there some standard library function in C++ which accepts multiple nullable (or emptyable) objects, and returns the first non-null? If not, has one been proposed, e.g. in the context of monadic programming perhaps?</p>