This patch adds the _LIBCPP_NO_DISCARD macro and applies it to various functions including:
- unique_ptr<T>::release()
- The empty(), size(), capacity() and max_size() methods of STL Containers and std::string.
- try_lock(), try_lock_for() and try_lock_until() of lockable types.
I just want to check that we agree on the general direction of this patch. Specifically that libc++ should be free to apply no_discard where we feel appropriate.
Additional suggestions welcome!
This patch fixes PR30898 (https://llvm.org/bugs/show_bug.cgi?id=30898)