llvm::ConstStrippingForwardingCast

Forwards const cast sources to a non-const CastInfo implementation.

Synopsis

Declared in <llvm/Support/Casting.h>

template<
    typename To,
    typename From,
    typename ForwardTo>
struct ConstStrippingForwardingCast;

Description

Provides a cast trait that strips const from types to make it easier to implement a const-version of a non-const cast. It just removes boilerplate and reduces the amount of code you as the user need to implement. You can use it like this:

template<> struct CastInfo<foo, bar> { ...verbose implementation... };

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

Type Aliases

NameDescription
DecayedFrom From with cv-qualifiers and pointer removed.
NonConstFrom Non-const pointer or reference form of From used for forwarding.

Static Member Functions

NameDescription
castFailed Forwards the failed-cast sentinel to the non-const ForwardTo trait.
doCast Forwards the cast to the non-const ForwardTo trait.
doCastIfPossible Forwards a fallible cast to the non-const ForwardTo trait.
isPossible Forwards the possibility check to the non-const ForwardTo trait.

Derived Classes

NameDescription
CastInfo<To, PointerUnion<PTs...> const> CastInfo specialization for const PointerUnion sources.