view: check the index directly before invoking ::each

This commit is contained in:
Michele Caini
2024-02-27 10:36:00 +01:00
parent 42c8df773c
commit 83576bf94e

View File

@@ -585,7 +585,7 @@ public:
*/
template<typename Func>
void each(Func func) const {
if(base_type::handle() != nullptr) {
if(this->index != sizeof...(Get)) {
pick_and_each(func, std::index_sequence_for<Get...>{});
}
}