This is a small refactoring step toward moving CodeView type stream logic from llvm-readobj to a library. It abstracts the logic of stepping through the stream into an iterator class and updates llvm-readobj to use that iterator. This has no functional change; llvm-readobj produces identical output.
The next step is to abstract the parsing of the different leaf types and then move that and the iterator into a library.
Since this is my first contrib outside LLDB, please let me know if I'm messing up on any of the LLVM style guidelines, idioms, or patterns.
You can use std::ignore if you don't want some of the results (eg: "std::tie(Leading, std::ignore)")
Or you could just write "return LeafData.split('\0').first;"
But this code was in the original, so not really your responsibility to refactor.