sandbox.cpp 1017 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include <iostream>
  2. #include "yaml-cpp/emitterstyle.h"
  3. #include "yaml-cpp/eventhandler.h"
  4. #include "yaml-cpp/yaml.h" // IWYU pragma: keep
  5. class NullEventHandler : public YAML::EventHandler {
  6. public:
  7. using Mark = YAML::Mark;
  8. using anchor_t = YAML::anchor_t;
  9. NullEventHandler() = default;
  10. void OnDocumentStart(const Mark&) override {}
  11. void OnDocumentEnd() override {}
  12. void OnNull(const Mark&, anchor_t) override {}
  13. void OnAlias(const Mark&, anchor_t) override {}
  14. void OnScalar(const Mark&, const std::string&, anchor_t,
  15. const std::string&) override {}
  16. void OnSequenceStart(const Mark&, const std::string&, anchor_t,
  17. YAML::EmitterStyle::value style) override {}
  18. void OnSequenceEnd() override {}
  19. void OnMapStart(const Mark&, const std::string&, anchor_t,
  20. YAML::EmitterStyle::value style) override {}
  21. void OnMapEnd() override {}
  22. };
  23. int main() {
  24. YAML::Node root;
  25. for (;;) {
  26. YAML::Node node;
  27. root = node;
  28. }
  29. return 0;
  30. }