LLVM  6.0.0svn
llvm::yaml::MappingContextTraits< T, Context > Struct Template Reference

This class is similar to MappingTraits<T> but allows you to pass in additional context for each map operation. More...

#include "llvm/Support/YAMLTraits.h"

Detailed Description

template<class T, class Context>
struct llvm::yaml::MappingContextTraits< T, Context >

This class is similar to MappingTraits<T> but allows you to pass in additional context for each map operation.

For example:

struct MappingContextTraits<MyStruct, MyContext> { static void mapping(IO &io, MyStruct &s, MyContext &c) { io.mapRequired("name", s.name); io.mapRequired("size", s.size); io.mapOptional("age", s.age); ++c.TimesMapped; } };

Definition at line 75 of file YAMLTraits.h.


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