WPILibC++ 2024.3.2
|
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 </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/Casting.h>
Static Public Member Functions | |
static To | castFailed () |
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
.
|
inlinestatic |