WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::util::OptionalValueCast< To, From, Derived > Struct Template Reference

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

#include <wpi/util/Casting.hpp>

Inheritance diagram for wpi::util::OptionalValueCast< To, From, Derived >:
wpi::util::CastIsPossible< To, From, Enable > wpi::util::DefaultDoCastIfPossible< std::optional< To >, From, detail::SelfType< void, OptionalValueCast< To, From > > > wpi::util::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::util::CastIsPossible< To, From, Enable >
static bool isPossible (const From &f)
Static Public Member Functions inherited from wpi::util::DefaultDoCastIfPossible< std::optional< To >, From, detail::SelfType< void, OptionalValueCast< To, From > > >
static To doCastIfPossible (From f)

Detailed Description

template<typename To, typename From, typename Derived = void>
struct wpi::util::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>
std::optional< To > wpi::util::OptionalValueCast< To, From, Derived >::castFailed ( )
inlinestatic

◆ doCast()

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

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