File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
llvm/include/llvm/Support Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -589,10 +589,6 @@ template <typename To, typename From>
589589// ValueIsPresent
590590// ===----------------------------------------------------------------------===//
591591
592- template <typename T>
593- constexpr bool IsNullable =
594- std::is_pointer_v<T> || std::is_constructible_v<T, std::nullptr_t >;
595-
596592// / ValueIsPresent provides a way to check if a value is, well, present. For
597593// / pointers, this is the equivalent of checking against nullptr, for Optionals
598594// / this is the equivalent of checking hasValue(). It also provides a method for
@@ -614,9 +610,9 @@ template <typename T> struct ValueIsPresent<std::optional<T>> {
614610 static inline decltype (auto ) unwrapValue(std::optional<T> &t) { return *t; }
615611};
616612
617- // If something is "nullable" then we just cast it to bool to see if it exists .
613+ // Specialization for types convertible to bool.
618614template <typename T>
619- struct ValueIsPresent <T, std::enable_if_t <IsNullable< T>>> {
615+ struct ValueIsPresent <T, std::enable_if_t <std::is_constructible_v< bool , T>>> {
620616 using UnwrappedType = T;
621617 static inline bool isPresent (const T &t) { return static_cast <bool >(t); }
622618 static inline decltype (auto ) unwrapValue(T &t) { return t; }
You can’t perform that action at this time.
0 commit comments