yaml-cpp icon indicating copy to clipboard operation
yaml-cpp copied to clipboard

Checking for key without mutation

Open robambalu opened this issue 3 years ago • 1 comments

Hi. I found it lacking that there is no interface to check for the existence of a key on a YAML Node. The only way to do it at the moment is to call operator with the key, and check if the result is valid. Although this works, it looks like it requires a mutation ( so its not really const ) and therefore cant be done safely across threads. Would it be possible to add a purely read-only hasKey-like method?

robambalu avatar Mar 18 '22 14:03 robambalu

Are there any guidelines on the yaml-cpp thread safety? Recently I encountered some crashes and finally had to mark some yaml related copy/access with #pragma omp critical to avoid the crash.

seisowl avatar Oct 04 '22 02:10 seisowl