Skip to content

Commit 309d88a

Browse files
committed
[hist] Throw on unimplemented axis type
This may cause a minor hit in the microbenchmark (for two dimensions), but this will likely be within noise together with future changes to check the argument types for a given axis type.
1 parent 3204de7 commit 309d88a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hist/histv7/inc/ROOT/RAxes.hxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ public:
5858
totalNumBins *= regular->GetTotalNumBins();
5959
} else if (auto *variable = std::get_if<RVariableBinAxis>(&axis)) {
6060
totalNumBins *= variable->GetTotalNumBins();
61+
} else {
62+
throw std::logic_error("unimplemented axis type");
6163
}
6264
}
6365
return totalNumBins;
@@ -75,6 +77,8 @@ private:
7577
} else if (auto *variable = std::get_if<RVariableBinAxis>(&axis)) {
7678
index *= variable->GetTotalNumBins();
7779
linIndex = variable->ComputeLinearizedIndex(std::get<I>(args));
80+
} else {
81+
throw std::logic_error("unimplemented axis type");
7882
}
7983
if (!linIndex.fValid) {
8084
return {0, false};

0 commit comments

Comments
 (0)