LLVM 22.0.0git
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"

Inheritance diagram for llvm::ValueIsPresent< T, Enable >:
[legend]

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>
bool llvm::ValueIsPresent< T, Enable >::isPresent ( const T & t)
inlinestatic

Definition at line 604 of file Casting.h.

References T.

◆ unwrapValue()

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

Definition at line 605 of file Casting.h.

References T.

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


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