1

I'm thinking of assigning my own unique id string to each YAML::Node via the SetTag() function. Is this possible, or is yaml-cpp referencing these tags internally, and it'll get confused? Also, is this likely to be a problem in future versions of the library?

2
  • This is the intended use of tags in yaml AFAIK and I use yaml-cpp with SetTag() for exactly this purpose. Note however, that I also had a few issues with the tag support in yaml-cpp: stackoverflow.com/questions/74502063/… Commented Dec 7, 2022 at 9:22
  • More precisely, I use the tags to tell my code about the type that the yaml node shall be deserialized to. I just realized this is not entirely what you want to do, right? So maybe your use case is not the intended use for yaml tags, but I suppose you could still use them... Commented Dec 7, 2022 at 9:32

1 Answer 1

2

Yes, it's possible!The yaml-cpp tags are intended for this purpose.

Also, is this likely to be a problem in future versions of the library?

It should not create problem in the future version of the library, but for safety you can ask a question to the mantainer on the github repo of the library opening an issue or a discussion if possible.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.