LLVM 22.0.0git
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"

Inheritance diagram for llvm::yaml::MappingContextTraits< T, Context >:
[legend]

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 85 of file YAMLTraits.h.


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