projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
286a137
)
Add EnumIndexedVector::indices().
author
Carl Hetherington
<cth@carlh.net>
Sun, 6 Nov 2022 20:50:54 +0000
(21:50 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 22 Dec 2022 23:12:00 +0000
(
00:12
+0100)
src/lib/enum_indexed_vector.h
patch
|
blob
|
history
diff --git
a/src/lib/enum_indexed_vector.h
b/src/lib/enum_indexed_vector.h
index 0187daba2f0a93389d6448d345f61cf4492b1762..ee34575ea3bd82758c6e1fdde8131a36dcef5ffb 100644
(file)
--- a/
src/lib/enum_indexed_vector.h
+++ b/
src/lib/enum_indexed_vector.h
@@
-70,8
+70,18
@@
public:
return _data.end();
}
+ std::vector<Enum> indices() const {
+ if (_indices.empty()) {
+ for (int i = 0; i < static_cast<int>(Enum::COUNT); ++i) {
+ _indices.push_back(static_cast<Enum>(i));
+ }
+ }
+ return _indices;
+ }
+
private:
std::vector<Type> _data;
+ mutable std::vector<Enum> _indices;
};