WPILibC++ 2024.3.2
wpi::OptionalValueCast< To, From, Derived > Struct Template Reference

This cast trait provides std::optional<T> casting. More...

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/Casting.h>

Inheritance diagram for wpi::OptionalValueCast< To, From, Derived >:
wpi::CastIsPossible< To, From, Enable > wpi::DefaultDoCastIfPossible< std::optional< To >, From, detail::SelfType< void, OptionalValueCast< To, From > > > wpi::CastInfo< To, std::optional< From > >

Static Public Member Functions

static std::optional< To > castFailed ()
 
static std::optional< To > doCast (const From &f)
 
- Static Public Member Functions inherited from wpi::CastIsPossible< To, From, Enable >
static bool isPossible (const From &f)
 
- Static Public Member Functions inherited from wpi::DefaultDoCastIfPossible< std::optional< To >, From, detail::SelfType< void, OptionalValueCast< To, From > > >
static std::optional< To > doCastIfPossible (From f)
 

Detailed Description

template<typename To, typename From, typename Derived = void>
struct wpi::OptionalValueCast< To, From, Derived >

This cast trait provides std::optional<T> casting.

This means that if you have a value type, you can cast it to another value type and have dyn_cast return an std::optional<T>.

Member Function Documentation

◆ castFailed()

template<typename To , typename From , typename Derived = void>
static std::optional< To > wpi::OptionalValueCast< To, From, Derived >::castFailed ( )
inlinestatic

◆ doCast()

template<typename To , typename From , typename Derived = void>
static std::optional< To > wpi::OptionalValueCast< To, From, Derived >::doCast ( const From &  f)
inlinestatic

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