From: Alex Ainscow Date: Fri, 28 Mar 2025 13:46:30 +0000 (+0000) Subject: common: Generalise to_interval_set to allow more interval_set implementations. X-Git-Tag: v20.3.0~29^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=59874ef7fb189457d3ff4edd0c65f91e00b46e3d;p=ceph.git common: Generalise to_interval_set to allow more interval_set implementations. This generalises to_interval_set so that the interval set does not need to share a common internal map structure with interval_map. The implementation is achieved through iteration, so there is no requirement for the old restriction. Signed-off-by: Alex Ainscow --- diff --git a/src/common/interval_map.h b/src/common/interval_map.h index 470bfb37618f..9ef7fcbe1549 100644 --- a/src/common/interval_map.h +++ b/src/common/interval_map.h @@ -209,8 +209,8 @@ public: } return ret; } - template - void to_interval_set(interval_set &set) const { + template class ISC = std::map, bool strict = true> + void to_interval_set(interval_set &set) const { for (auto &&i: *this) { set.insert(i.get_off(), i.get_len()); }