A compile-time map for a subset of an enumeration
The merge request introduces a map of a subset of an enumeration entries.
Example:
using CbmRecoDetMapper_t = cbm::util::EnumMapper<
ECbmModuleId::kMvd,
ECbmModuleId::kSts,
ECbmModuleId::kRich,
ECbmModuleId::kMuch,
ECbmModuleId::kTrd,
ECbmModuleId::kTof,
ECbmModuleId::kMust,
ECbmModuleId::kBmon,
ECbmModuleId::kTrd2d,
ECbmModuleId::kFsd>;
template<typename T>
using CbmRecoDetMap_t = cbm::util::EnumMap<T, CbmRecoDetMapper_t>;
Merge request reports
Activity
requested review from @se.gorbunov
assigned to @s.zharko
added 1 commit
- a048f61e - A compile-time map for a subset of an enumeration
added 4 commits
-
a048f61e...21ab95f6 - 3 commits from branch
computing:master
- e6501338 - A compile-time map for a subset of an enumeration
-
a048f61e...21ab95f6 - 3 commits from branch
added 1 commit
- df48d4cf - A compile-time map for a subset of an enumeration
Dear @d.smith, @fweig, @se.gorbunov, @s.zharko, @f.uhlig, @v.friese, @p.-a.loizeau,
you have been identified as code owner of at least one file which was changed with this merge request.
Please check the changes and approve them or request changes.
added CodeOwners label
removed review request for @se.gorbunov
requested review from @j.decuveland
- Resolved by Sergei Zharko
Could you explain better what this is good for and why we seem to constantly be trying to enhance the STL? I guess you need this for loops. Why does a simple EnumClass not do the job?
added 5 commits
-
df48d4cf...a58905f1 - 4 commits from branch
computing:master
- 8bd6d22f - A compile-time map for a subset of an enumeration
-
df48d4cf...a58905f1 - 4 commits from branch
mentioned in merge request !2094
added 13 commits
-
8bd6d22f...0a87288c - 12 commits from branch
computing:master
- b3c9f0c2 - A compile-time map for a subset of an enumeration
-
8bd6d22f...0a87288c - 12 commits from branch
added 3 commits
-
b3c9f0c2...de3fcc76 - 2 commits from branch
computing:master
- d357e592 - A compile-time map for a subset of an enumeration
-
b3c9f0c2...de3fcc76 - 2 commits from branch
added 1 commit
- 267ccaac - A compile-time map for a subset of an enumeration
- Resolved by Volker Friese
Thanks for working on this! This is quite sophisticated code - I can follow the general approach, though I'll admit not every line is immediately clear to me.
I find myself somewhat ambivalent about this implementation. On one hand, the use case seems fairly narrow (compile-time known subsets of enums with associated data storage), and I wonder if a less template-heavy solution might have been more straightforward for future maintainability.
On the other hand, I can appreciate the technical elegance here, and given the many existing challenges in cbmroot, this appears to compile and function correctly - which is actually a good thing, honestly.
My main question is about the broader applicability: how frequently do we expect this pattern to be useful? I tend to think that as our code becomes more optimized, cross-subdetector abstractions may become less relevant online, but I'm curious about your perspective on the expected future use cases.
Overall, while I have some reservations about complexity vs. utility, I don't see any blocking issues. Would be interested in your thoughts on the design tradeoffs.
added 12 commits
-
267ccaac...bd8f97bb - 11 commits from branch
computing:master
- ecc4913c - A compile-time map for a subset of an enumeration
-
267ccaac...bd8f97bb - 11 commits from branch