LLVM: llvm::yaml::PolymorphicTraits< T > Struct Template Reference (original) (raw)
This class should be specialized by any type that can be represented as a scalar, map, or sequence, decided dynamically. More...
#include "[llvm/Support/YAMLTraits.h](YAMLTraits%5F8h%5Fsource.html)"
template<typename T>
struct llvm::yaml::PolymorphicTraits< T >
This class should be specialized by any type that can be represented as a scalar, map, or sequence, decided dynamically.
For example:
typedef std::unique_ptr MyPoly;
template<> struct PolymorphicTraits { static NodeKind getKind(const MyPoly &poly) { return poly->getKind(); } static MyScalar& getAsScalar(MyPoly &poly) { if (!poly || !isa(poly)) poly.reset(new MyScalar()); return *cast(poly.get()); } // ... };
Definition at line 295 of file YAMLTraits.h.
The documentation for this struct was generated from the following file:
- include/llvm/Support/YAMLTraits.h