14#ifndef LLVM_CLANG_BASIC_OPTIONAL_UNSIGNED_H
15#define LLVM_CLANG_BASIC_OPTIONAL_UNSIGNED_H
18#include <llvm/ADT/STLForwardCompat.h>
25 typename std::conditional_t<std::is_enum_v<T>, std::underlying_type<T>,
26 llvm::type_identity<T>>
::type;
27 static_assert(std::is_unsigned_v<underlying_type>);
37 return {std::nullopt, Rep};
41 constexpr bool has_value()
const {
return Rep != 0; }
46 return static_cast<T
>(Rep - 1);
52 return LHS && RHS ? *LHS == *RHS :
bool(LHS) ==
bool(RHS);
59 return LHS != RHS && (!LHS || (RHS && *LHS < *RHS));
62 return LHS == RHS || LHS < RHS;
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
The JSON file list parser is used to communicate input to InstallAPI.
OptionalUnsigned< unsigned > UnsignedOrNone
friend constexpr bool operator>(OptionalUnsigned LHS, OptionalUnsigned RHS)
constexpr bool has_value() const
constexpr underlying_type toInternalRepresentation() const
friend constexpr bool operator!=(OptionalUnsigned LHS, OptionalUnsigned RHS)
static constexpr OptionalUnsigned fromInternalRepresentation(underlying_type Rep)
friend constexpr bool operator==(OptionalUnsigned LHS, OptionalUnsigned RHS)
typename std::conditional_t< std::is_enum_v< T >, std::underlying_type< T >, llvm::type_identity< T > >::type underlying_type
friend constexpr bool operator<(OptionalUnsigned LHS, OptionalUnsigned RHS)
friend constexpr bool operator>=(OptionalUnsigned LHS, OptionalUnsigned RHS)
constexpr OptionalUnsigned(std::nullopt_t)
friend constexpr bool operator<=(OptionalUnsigned LHS, OptionalUnsigned RHS)
OptionalUnsigned(int)=delete