oil: update iterator for range based for loops

This commit is contained in:
Jake Hillion 2023-09-14 03:28:07 -07:00 committed by Jake Hillion
parent ac8ad26407
commit 1d387ca880
2 changed files with 9 additions and 0 deletions

View File

@ -41,9 +41,15 @@ inline IntrospectionResult::const_iterator::const_iterator(
std::vector<uint8_t>::const_iterator data)
: data_(data) {
}
inline IntrospectionResult::const_iterator IntrospectionResult::begin() const {
return cbegin();
}
inline IntrospectionResult::const_iterator IntrospectionResult::cbegin() const {
return ++const_iterator{buf_.cbegin(), inst_};
}
inline IntrospectionResult::const_iterator IntrospectionResult::end() const {
return cend();
}
inline IntrospectionResult::const_iterator IntrospectionResult::cend() const {
return {buf_.cend()};
}

View File

@ -56,7 +56,10 @@ class IntrospectionResult {
IntrospectionResult(std::vector<uint8_t> buf, exporters::inst::Inst inst);
const_iterator begin() const;
const_iterator cbegin() const;
const_iterator end() const;
const_iterator cend() const;
private: