[llvm] [ADT] Specialize ValueIsPresent for PointerUnion (PR #121847)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 16:21:22 PST 2025


================
@@ -614,9 +610,9 @@ template <typename T> struct ValueIsPresent<std::optional<T>> {
   static inline decltype(auto) unwrapValue(std::optional<T> &t) { return *t; }
 };
 
-// If something is "nullable" then we just cast it to bool to see if it exists.
+// Specialization for types convertible to bool.
 template <typename T>
-struct ValueIsPresent<T, std::enable_if_t<IsNullable<T>>> {
+struct ValueIsPresent<T, std::enable_if_t<std::is_constructible_v<bool, T>>> {
----------------
kuhar wrote:

Ah, I just saw https://github.com/llvm/llvm-project/pull/121847#discussion_r1908008171

https://github.com/llvm/llvm-project/pull/121847


More information about the llvm-commits mailing list