LLVM 20.0.0git
Public Types | Static Public Member Functions | List of all members
llvm::ValueIsPresent< T, Enable > Struct Template Reference

ValueIsPresent provides a way to check if a value is, well, present. More...

#include "llvm/Support/Casting.h"

Public Types

using UnwrappedType = T
 

Static Public Member Functions

static bool isPresent (const T &t)
 
static decltype(auto) unwrapValue (T &t)
 

Detailed Description

template<typename T, typename Enable = void>
struct llvm::ValueIsPresent< T, Enable >

ValueIsPresent provides a way to check if a value is, well, present.

For pointers, this is the equivalent of checking against nullptr, for Optionals this is the equivalent of checking hasValue(). It also provides a method for unwrapping a value (think calling .value() on an optional).

Definition at line 602 of file Casting.h.

Member Typedef Documentation

◆ UnwrappedType

template<typename T , typename Enable = void>
using llvm::ValueIsPresent< T, Enable >::UnwrappedType = T

Definition at line 603 of file Casting.h.

Member Function Documentation

◆ isPresent()

template<typename T , typename Enable = void>
static bool llvm::ValueIsPresent< T, Enable >::isPresent ( const T t)
inlinestatic

Definition at line 604 of file Casting.h.

◆ unwrapValue()

template<typename T , typename Enable = void>
static decltype(auto) llvm::ValueIsPresent< T, Enable >::unwrapValue ( T t)
inlinestatic

Definition at line 605 of file Casting.h.

Referenced by llvm::detail::unwrapValue().


The documentation for this struct was generated from the following file: