summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/collection.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/collection.h b/lib/collection.h
index 8e9cf1a..b7d7d81 100644
--- a/lib/collection.h
+++ b/lib/collection.h
@@ -237,11 +237,12 @@ protected:
template<typename T>
requires((std::is_base_of_v<Others, T> || ...))
- [[nodiscard]] consteval static bool
+ [[nodiscard]] consteval static size_t
idx()
{
size_t typeIdx = 0;
- return ((typeIdx++ && std::is_base_of_v<Others, T>) || ...);
+ auto found = ((++typeIdx && std::is_base_of_v<Others, T>) || ...);
+ return typeIdx - found;
}
template<typename T>