]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Generalise to_interval_set to allow more interval_set implementations.
authorAlex Ainscow <aainscow@uk.ibm.com>
Fri, 28 Mar 2025 13:46:30 +0000 (13:46 +0000)
committerAlex Ainscow <aainscow@uk.ibm.com>
Tue, 22 Apr 2025 07:38:14 +0000 (08:38 +0100)
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 <aainscow@uk.ibm.com>
src/common/interval_map.h

index 470bfb37618f05444cac3b5183ebfe435d811440..9ef7fcbe1549d9708f0a0f0b46382988e8f379d4 100644 (file)
@@ -209,8 +209,8 @@ public:
     }
     return ret;
   }
-  template<bool strict = true>
-  void to_interval_set(interval_set<K, C, strict> &set) const {
+  template<template<typename, typename, typename ...> class ISC = std::map, bool strict = true>
+  void to_interval_set(interval_set<K, ISC, strict> &set) const {
     for (auto &&i: *this) {
       set.insert(i.get_off(), i.get_len());
     }