LLVM 19.0.0git
Static Public Member Functions | List of all members
llvm::NullableValueCastFailed< To > Struct Template Reference

All of these cast traits are meant to be implementations for useful casts that users may want to use that are outside the standard behavior. More...

#include "llvm/Support/Casting.h"

Inheritance diagram for llvm::NullableValueCastFailed< To >:
Inheritance graph
[legend]

Static Public Member Functions

static To castFailed ()
 

Detailed Description

template<typename To>
struct llvm::NullableValueCastFailed< To >

All of these cast traits are meant to be implementations for useful casts that users may want to use that are outside the standard behavior.

An example of how to use a special cast called CastTrait is:

template<> struct CastInfo<foo, bar> : public CastTrait<foo, bar> {};

Essentially, if your use case falls directly into one of the use cases supported by a given cast trait, simply inherit your special CastInfo directly from one of these to avoid having to reimplement the boilerplate isPossible/castFailed/doCast/doCastIfPossible. A cast trait can also provide a subset of those functions. This cast trait just provides castFailed for the specified To type to make CastInfo specializations more declarative. In order to use this, the target result type must be To and To must be constructible from nullptr.

Definition at line 301 of file Casting.h.

Member Function Documentation

◆ castFailed()

template<typename To >
static To llvm::NullableValueCastFailed< To >::castFailed ( )
inlinestatic

Definition at line 302 of file Casting.h.


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