LLVM 20.0.0git
Public Member Functions | List of all members
llvm::FailureOr< T > Class Template Reference

This class provides support for representing a failure result, or a valid value of type T. More...

#include "llvm/Support/LogicalResult.h"

Inheritance diagram for llvm::FailureOr< T >:
Inheritance graph
[legend]

Public Member Functions

 FailureOr (LogicalResult Result)
 Allow constructing from a LogicalResult.
 
 FailureOr ()
 
 FailureOr (T &&Y)
 
 FailureOr (const T &Y)
 
template<typename U , std::enable_if_t< std::is_constructible< T, U >::value > * = nullptr>
 FailureOr (const FailureOr< U > &Other)
 
 operator LogicalResult () const
 

Detailed Description

template<typename T>
class llvm::FailureOr< T >

This class provides support for representing a failure result, or a valid value of type T.

This allows for integrating with LogicalResult, while also providing a value on the success path.

Definition at line 76 of file LogicalResult.h.

Constructor & Destructor Documentation

◆ FailureOr() [1/5]

template<typename T >
llvm::FailureOr< T >::FailureOr ( LogicalResult  Result)
inline

Allow constructing from a LogicalResult.

The result must be a failure. Success results should use a proper instance of type T.

Definition at line 80 of file LogicalResult.h.

References assert(), and llvm::failed().

◆ FailureOr() [2/5]

template<typename T >
llvm::FailureOr< T >::FailureOr ( )
inline

Definition at line 84 of file LogicalResult.h.

References llvm::failure().

◆ FailureOr() [3/5]

template<typename T >
llvm::FailureOr< T >::FailureOr ( T &&  Y)
inline

Definition at line 85 of file LogicalResult.h.

◆ FailureOr() [4/5]

template<typename T >
llvm::FailureOr< T >::FailureOr ( const T Y)
inline

Definition at line 86 of file LogicalResult.h.

◆ FailureOr() [5/5]

template<typename T >
template<typename U , std::enable_if_t< std::is_constructible< T, U >::value > * = nullptr>
llvm::FailureOr< T >::FailureOr ( const FailureOr< U > &  Other)
inline

Definition at line 89 of file LogicalResult.h.

References llvm::failed().

Member Function Documentation

◆ operator LogicalResult()

template<typename T >
llvm::FailureOr< T >::operator LogicalResult ( ) const
inline

Definition at line 93 of file LogicalResult.h.

References llvm::success().


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