struct ForwardToPointerCast

Declaration

template <typename To, typename From, typename ForwardTo>
struct ForwardToPointerCast { /* full declaration omitted */ };

Description

Provides a cast trait that uses a defined pointer to pointer cast as a base for reference-to-reference casts. Note that it does not provide castFailed and doCastIfPossible because a pointer-to-pointer cast would likely just return `nullptr` which could cause nullptr dereference. You can use it like this: template < > struct CastInfo <foo , bar *> { ... verbose implementation... }; template < > struct CastInfo <foo , bar> : public ForwardToPointerCast <foo , bar, CastInfo <foo , bar *>> {};

Declared at: llvm/include/llvm/Support/Casting.h:424

Templates

To
From
ForwardTo

Method Overview

  • public static inline decltype(auto) doCast(const From & f)
  • public static inline bool isPossible(const From & f)

Methods

static inline decltype(auto) doCast(const From& f)

Declared at: llvm/include/llvm/Support/Casting.h:429

Parameters

const From& f

static inline bool isPossible(const From& f)

Declared at: llvm/include/llvm/Support/Casting.h:425

Parameters

const From& f